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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Flo_Rian_23
New Member

Multiply the column A with each of the 600 following columns, creating 600 new columns

Help please,

 

I have an Excel Table with 1000 prices (rows) in column A, which need to be multiplied with the quanities (per day) on the ca. 600 columns from B to XC. Since these are 600.000 multiplications, slowing Excel badly and sensitive to the smalest insertion or error, I want to switch to Query.

 

Is there a way of creating 600 new columns with an Excel Query at once, the first one A*B, then A*C, then A*D....  until all 600 columns are multiplied with column A?

 

Thanks!!!

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You can take a copy of the imported table, unpivot the non-price columns, replace the quantity values with the quantity * price and then pivot the column back to the original format. 
A small example would look like...
Source

jgeddes_0-1716490529801.png

Unpivot

jgeddes_1-1716490551236.png

Replace Values 

 

Table.ReplaceValue(#"Unpivoted Other Columns",each [Value], each [Value] * [Price],Replacer.ReplaceValue,{"Value"})

 

jgeddes_2-1716490599543.png

Pivot Column (I changed the Value Column to number type prior to this step.)

 

= Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Attribute]), "Attribute", "Value")

 

jgeddes_3-1716490656238.png

Hope this helps.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
slorin
Super User
Super User

Hi @Flo_Rian_23 

Power Query, one step with Table.ReplaceValue

 

= Table.ReplaceValue(
Your_Source,
each [Price],
null,
(value, price, z) => value*price,
List.Skip(Table.ColumnNames(Your_Source))
)

Excel

You copy the data from column A (up to row 1000)

You select the data from column B to column CX (also up to row 1000)

Paste Special, in value and multiplication

 

Stéphane

jgeddes
Super User
Super User

You can take a copy of the imported table, unpivot the non-price columns, replace the quantity values with the quantity * price and then pivot the column back to the original format. 
A small example would look like...
Source

jgeddes_0-1716490529801.png

Unpivot

jgeddes_1-1716490551236.png

Replace Values 

 

Table.ReplaceValue(#"Unpivoted Other Columns",each [Value], each [Value] * [Price],Replacer.ReplaceValue,{"Value"})

 

jgeddes_2-1716490599543.png

Pivot Column (I changed the Value Column to number type prior to this step.)

 

= Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Attribute]), "Attribute", "Value")

 

jgeddes_3-1716490656238.png

Hope this helps.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you, that worked like a charm!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.

Top Solution Authors