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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!