Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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!!!
Solved! Go to Solution.
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
Unpivot
Replace Values
Table.ReplaceValue(#"Unpivoted Other Columns",each [Value], each [Value] * [Price],Replacer.ReplaceValue,{"Value"})
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")
Hope this helps.
Proud to be a 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
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
Unpivot
Replace Values
Table.ReplaceValue(#"Unpivoted Other Columns",each [Value], each [Value] * [Price],Replacer.ReplaceValue,{"Value"})
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")
Hope this helps.
Proud to be a Super User! | |
Thank you, that worked like a charm!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
7 | |
7 | |
6 | |
5 |
User | Count |
---|---|
11 | |
11 | |
9 | |
6 | |
6 |