OpenBI Docs Buy

Table.TransformRows

A list made by a function of each row: one value per row, in the table's order.

Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Table.TransformRows(table as table, transform as function) as list
ParameterTypeDescription
tabletableThe table whose rows to go through.
transformfunctionA function of a row (a record) that gives the list's value for that row.

Returns

list. A value per row.

Remarks

  • The result is a list, not a table: give records and wrap the list in Table.FromRecords to get a table back.

Examples

A line of text per product

Table.TransformRows(#table({"Product", "Price"}, {{"Chair", 50}, {"Desk", 120}}), each [Product] & ": " & Text.From([Price]))
{"Chair: 50", "Desk: 120"}

Back to a table

Table.FromRecords(Table.TransformRows(#table({"Product", "Price"}, {{"Chair", 50}, {"Desk", 120}}), each [Product = [Product], WithVat = [Price] * 1.25]))
ProductWithVat
Chair62.5
Desk150

Table.ToList, Table.AddColumn, List.Transform, Table.FromRecords.

Last updated · OpenBI Studio 0.3.79