Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

multiply columns by one column

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

Column1Column2Column3Column4
2121
3113

 

After transformation of columns we get:

Column1Column2Column3Column4
2242
3339

 

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?


1 ACCEPTED SOLUTION
Anonymous
Not applicable

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] * _}))))

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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] * _}))))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.