cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SarikaB
Regular Visitor

Cummulative Sum Based on Same Rank Issues

Hello Team, 

 

I am trying to do a Cummulative Sales based on Rank

 

Here, is my 

Rank Measure=

mRank = RANKX(ALL(PostedSalesInvoiceLines[No],PostedSalesInvoiceLines[CustName]),[mTotalSales],,DESC,Dense)
Cummulative Sales Measure:
mCumSsales = CALCULATE ([mTotalSales],TOPN([mRank],ALL ( 'PostedSalesInvoiceLines' ),[mTotalSales]))
SarikaB_0-1630584568848.png

 

Cummulative sum is not happening during same ranks.

 

Kindly let me know how to resolve.

 

Regards,

Sarika

1 REPLY 1
wdx223_Daniel
Super User
Super User

mCumSsales = VAR _rx=[mRank] RETURN CALCULATE ([mTotalSales],FILTER(ALL(PostedSalesInvoiceLines[No],PostedSalesInvoiceLines[CustName]),[mRank]<=_rx))

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.