Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi
Suppose i've got a sales table with detail about products etc.. and 3 years (2018 / 2019 / 2020)
Here's my issue, i need to perform that kind of calculation :
1 - do a classic sumx on my dataset, let's say sum by year of QTTE by PRICE
2018 - 10 000
2019 - 11 500
2020 - 20 000
2 - then divide these sumx measure by the value i got for 2018
2018 - 1 (10 000 / 10 000)
2019 - 1.15
2020 - 2
Because of the sumx that stick me with the row context, the classic CALCULATE(result ; year = 2018) doesn't work.
I hope i'm clear enough.
Thank you guys
Stephane
Solved! Go to Solution.
@Anonymous not sure what the issue or what is not working
following measures will work
Total Sum = SUM( Table[Column] ) Sum 2018 = CALCULATE ( [Total Sum], All(Table), Table[Year] = 2018 ) Ratio = DIVIDE( [Total Sum], [Sum 2018] )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @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! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous not sure what the issue or what is not working
following measures will work
Total Sum = SUM( Table[Column] ) Sum 2018 = CALCULATE ( [Total Sum], All(Table), Table[Year] = 2018 ) Ratio = DIVIDE( [Total Sum], [Sum 2018] )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @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! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @parry2k
i found the problem :
i was using VARIABLES and that was disrupting my calculations.
----
WRONG_RESULT =
VAR Total Sum = SUM( Table[Column] )
VAR Sum 2018 = CALCULATE ( [Total Sum], All(Table), Table[Year] = 2018 )
VAR Result = DIVIDE( [Total Sum], [Sum 2018] )
RETURN Result
The [Sum 2018] wasn't correct.
CORRECT_RESULT =
VAR Sum 2018 = CALCULATE ( SUM( Table[Column] ), All(Table), Table[Year] = 2018 )
VAR Result = DIVIDE( [Total Sum], [Sum 2018] )
RETURN Result
I tried to upload my dummy.pbix file but i didn't find where to attach it...
mmmh i should have tried this before asking you : building a dummy pbix to show you my issue.
While doing it i realize that my issue does not come from the formula as the CALCULATE(sumx;filter) is working fine indeed.
Well now i know i need to focus elsewhere to debug the **bleep** thing.
Thanks for your help !
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |