Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

[Cumulative Sum] One Pareto per Day

I'm trying to perform an analysis in which I can see the biggest understocks and overstocks in a Pareto chart for a selected date. To achieve this, I need a cumulative sum of all volumes, taking on account the biggest gap/excess in the referred day.
My data is being displayed as below. The headers in grey are already available; the red and yellow headers are those that I'm striving to obtain. Despite being shown as columns, they should be measures.

 

ProductDayUnderstockUndRankCumUndCumUnd%OverstockOveRankCumOveCumOve%
01234567AB01/01/202080219076%    
12345678BC01/01/202050324096%    
23456789CD01/01/2020110111044%    
34567890DE01/01/2020    552115100%
45678901EF01/01/2020104250100%    
56789012FG01/01/2020    6016052%
01234567AB02/01/20209019042%    
12345678BC02/01/2020453215100%    
23456789CD02/01/202080217079%    
34567890DE02/01/2020    50210591%
45678901EF02/01/2020    103115100%
56789012FG02/01/2020    5515548%

 

 

So far, I was had worked only with the latest date, so the formulas below had been enough. I tried a lot of different solutions, but with no success. If the MAX formula considers the maximum value for the day shown in the row, I believe it will be enough.

 

CumUnd = CALCULATE(SUM(Table[Understock]), FILTER(ALLSELECTED(Table), Table[UndRank] <= MAX(Pareto[UndRank])))

CumUnd% = [CumUnd]/CALCULATE(SUM(Table[Understock]), ALL(Table))
 
Thanks in advance for any help you can provide!
2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

Hi, @Anonymous , you might want to refer to the attached file  for details.

Screenshot 2020-12-06 131607.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Thanks a lot, @CNENFRNL!

 

It works perfectly! Now I'll go a little deeper in the formula to understand the logic behind it.

 

Kind regards!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.