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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

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

Top Solution Authors