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] )]
)
Related functions
Other functions related to Table.TransformRows are:
- Table.CombineColumns
- Table.CombineColumnsToRecord
- Table.PrefixColumns
- Table.SplitColumn
- Table.TransformColumnTypes
- Table.TransformColumns
