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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors