The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
I have a doubt in the calculation of the cumulative percentage (right column).
When I order the rows by the amount the metric stops working because it is created according to the alphabetical order of the customers. This cumulative column would have to add the value of that company plus all the previous ones, reaching the last row with 100%.
Here is the measure I created for the running total:
Running Total=
var sales = CALCULATE (SUM ('table'[Amount]),
FILTER (ALLSELECTED('table'[Customer]), ISONORAFTER ('table'[Customer], MAX ('table'[Customer]), DESC)))
var totalsales = CALCULATE (SUM ('table'[Amount]), ALLSELECTED ('table'))
Return
DIVIDE (sales, totalsales)
Any help is welcome 😀
Solved! Go to Solution.
Hello,
I followed this link to resolve it: Cumulative Running Total Based on Highest Value - Excelerator BI
Thanks @AlexisOlson anyway!
Hi @Anonymous,
Did AlexisOlson's suggestions help with your scenario? if that is the case, you can consider Kudo or accept his suggestions to help others who faced similar requirements.
If that also doesn't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hello,
I followed this link to resolve it: Cumulative Running Total Based on Highest Value - Excelerator BI
Thanks @AlexisOlson anyway!
HI @Anonymous,
Thanks for sharing the solution about your scenario, I think they may help others who faced a similar requirement.😊
Regards,
Xiaoxin Sheng
If you want it ordered by amount, then use that ordering for the cumulative total.
Running Total =
VAR currAmount = SELECTEDVALUE ( 'table'[Amount] )
VAR sales =
CALCULATE (
SUM ( 'table'[Amount] ),
FILTER ( ALLSELECTED ( 'table' ), 'table'[Amount] >= currAmount )
)
VAR totalsales =
CALCULATE ( SUM ( 'table'[Amount] ), ALLSELECTED ( 'table' ) )
RETURN
DIVIDE ( sales, totalsales )
User | Count |
---|---|
78 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
52 | |
50 | |
46 |