Table.TransformRows

Updated on

Table.TransformRows is a Power Query M function that creates a list by applying the transform operation to each row in a table. The function returns a list containing the transformed rows.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Table.TransformRows(
   table as table,
   transform as function,
) as list

Description

Table.TransformRows transforms the rows of the table using the specified transform function. It creates a list by applying the transform operation to each row in table.

Examples

Transform the rows of a table into a list of numbers.

// Output: {1, 2, 3, 4, 5}
Table.TransformRows( 
    Table.FromRecords( {
        [a = 1],
        [a = 2],
        [a = 3],
        [a = 4],
        [a = 5]
    } ),
    each [a]
 )

Transform the rows of a numeric table into textual records.

Table.TransformRows( 
    Table.FromRecords( {
        [a = 1],
        [a = 2],
        [a = 3],
        [a = 4],
        [a = 5]
    } ),
    ( row ) as record => [B = Number.ToText( row[a] )]
 )

Other functions related to Table.TransformRows are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/table-transformrows