Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All
I need to transform a bunch of columns by multiplying them on row level by values in a column:
Ex in tabel below I need to multiply Column2, Column3 & Column4 by Column1
| Column1 | Column2 | Column3 | Column4 |
| 2 | 1 | 2 | 1 |
| 3 | 1 | 1 | 3 |
After transformation of columns we get:
| Column1 | Column2 | Column3 | Column4 |
| 2 | 2 | 4 | 2 |
| 3 | 3 | 3 | 9 |
It feels like one should be able to do this in one step with M code. what I basicly whant to do is: for each of these columns multiply the value on each row with the value in this column on same row.
Does anyone know if this is possible?
Solved! Go to Solution.
Sorted it out my self, this worked.
Table.FromRecords(Table.TransformRows(#"Changed Type", (x) => Record.TransformFields(x, List.Transform({"Column2", "Column3", "Column4"}, (y) => {y, each x[Column1] * _}))))
Sorted it out my self, this worked.
Table.FromRecords(Table.TransformRows(#"Changed Type", (x) => Record.TransformFields(x, List.Transform({"Column2", "Column3", "Column4"}, (y) => {y, each x[Column1] * _}))))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!