Multiplying Two Columns in Power BI
-
Multiplying Two Columns in Power BI
Multiplying Two Columns in Power BIFollow
Bob McMullen
Bob McMullenFeb 01, 2023 02:52 PM
I am trying to multiply two different columns in the same table in BI. I have tried a measure and …
1. Multiplying Two Columns in Power BIBronze Contributor
Bob McMullen
Posted Feb 01, 2023 02:52 PM
I am trying to multiply two different columns in the same table in BI.I have tried a measure and a calculated column to create a cost sorting factor, and both of them are incorrect.
Measure: Sorting Factor = SUMX(‘AWD-RbA Append’,’AWD-RbA Append'[Adjusted Cost] * ‘AWD-RbA Append'[Occurrences Total])
Column: Sort = ‘AWD-RbA Append'[Occurrences Total]*’AWD-RbA Append'[Adjusted Cost]
They both return the same value, but neither is correct.
Any ideas?
Thanks!
image
——————————
Bob McMullen
Project Manager
Bayport MN
6512642569
——————————2. RE: Multiplying Two Columns in Power BI
Bronze Contributor
James Watts
Posted Feb 02, 2023 06:53 AM
Is the number you [sum of cost] * [sum of occurrences] ? What you have been calculating is the sum of [cost] * [occurrences].If you a product with two rows in the database:
Occurrences Cost Occur * Cost
1 5 5
3 1 3
Is what you want to see (3+1) * (5+1), which is 24 ?——————————
James Watts
Business Intelligence Analyst
——————————3. RE: Multiplying Two Columns in Power BI
Bronze Contributor
Bob McMullen
Posted Feb 02, 2023 04:56 PM
James,Thanks for your reply!
I got the script fixed. I was close, but not quite right. The correct script is:
= sum(‘AWD-RbA Append'[Occurrences Total]) * sum(‘AWD-RbA Append'[Adjusted Cost])
Thanks!
Bob McMullen.
Sorry, there were no replies found.
The discussion ‘Multiplying Two Columns in Power BI’ is closed to new replies.