List.Transform
A new list with a function applied to each item.
Group: List. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
List.Transform(list as list, transform as function) as list
| Parameter | Type | Description |
|---|---|---|
list | list | The items to change. |
transform | function | A function of one item that gives the new value. |
Returns
list. As many items as the list, each the function's answer.
Examples
Prices with 25 % VAT
List.Transform({100, 250, 80}, each _ * 1.25)
{125, 312.5, 100}
City names in proper case
List.Transform({"oslo", "BERGEN"}, Text.Proper)
{"Oslo", "Bergen"}
Related functions
List.TransformMany, List.Accumulate, Table.TransformColumns.