Forum Discussion
DarrenLau
Advocate I
7 years agoCumulative Sum - What am I missing?
Trying to get a cumulative sum (and then a cumulative percentage) value into a matrix table, but I am just not able to get the correct calculations. Here are 3 different combinations (amongst the man...
- 7 years ago
Hi,
Try these measures
Rank = if([Disti Net Sales] = BLANK(),BLANK(),RANKX(ALL('Sales data'[City]),[Disti Net Sales]))
Cumulative Disti Net sales = SUMX(TOPN([Rank],CALCULATETABLE(VALUES('Sales data'[City]),ALL('Sales data'[City])),[Disti Net Sales]),[Disti Net Sales])
Cumulative Disti Net sales (%) = [Cumulative Disti Net sales]/CALCULATE([Cumulative Disti Net sales],all('Sales data'[City]))
Hope this helps.
- 7 years ago
Hi Ashish_Mathur ,
Thank you for the measures. The cumulative % measure was not working, but I edited it to :-
Cumulative Disti Net Sales % = DIVIDE( [Cumulative Disti Net Sales] , CALCULATE(SUM('Sales Data'[Invoice-Doc]), ALL('Sales Data'[City])) , BLANK() )And it's showing the cumulative percentages now.
DarrenLau
Advocate I
7 years agoHi Ashish_Mathur ,
Thank you for the measures. The cumulative % measure was not working, but I edited it to :-
Cumulative Disti Net Sales % =
DIVIDE( [Cumulative Disti Net Sales] ,
CALCULATE(SUM('Sales Data'[Invoice-Doc]), ALL('Sales Data'[City])) ,
BLANK()
)And it's showing the cumulative percentages now.
Ashish_Mathur
Super User
7 years agoYou are welcome.