Forum Discussion
Incorrect total with dax measure
Hi all
My dax measure is not returning the correct total.
The dax is:
The column on the left has the correct total, and the one on the right the incorrect total.
The measure I use is:
Cost What If =
DIVIDE(
SUM('DB'[Demand]) * 'Sugar Value'[Parameter Value] * 0.01,
1000)
*
MAX('DB'[Cost per Ton])
How can I get the total right?
Thanks.
o59393 Try this, use the column you have on the rows:
Cost What If = SUMX ( VALUES ( YourTable[ColumnOnRows] ), DIVIDE ( CALCULATE ( SUM ( 'DB'[Demand] ) ) * 'Sugar Value'[Parameter Value] * 0.01, 1000 ) * CALCULATE ( MAX ( 'DB'[Cost per Ton] ) ) )👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️
3 Replies
- parry2k
Super User
o59393 Try this, use the column you have on the rows:
Cost What If = SUMX ( VALUES ( YourTable[ColumnOnRows] ), DIVIDE ( CALCULATE ( SUM ( 'DB'[Demand] ) ) * 'Sugar Value'[Parameter Value] * 0.01, 1000 ) * CALCULATE ( MAX ( 'DB'[Cost per Ton] ) ) )👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️