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!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors