Table.TransformRows

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

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:

BI Gorilla Blog

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/table-transformrows
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.