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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
JANSAN
Frequent Visitor

Cumulated Sum with multiple Categories

Hello;

I want to create a table in which a measure is being cumulated. The Measure should be summed up by two categories. Having one category for the cumulation works, however if I use two categories it does not work. 

 

 

 

 

 

Bruch (kg) = SUM('Unpivoted Bruch '[AnzahlBruch(kg)])

 

 

 

 



 

 

 

 

Cumulative Total = 
VAR cumulativbruch = [Bruch (kg)]
RETURN 
CALCULATE(  
    [Bruch (kg)],
    FILTER(
        ALLSELECTED('Unpivoted Bruch '[Materialkurztext], 'Unpivoted Bruch '[BruchType] ),
        [Bruch (kg)] >= cumulativbruch
    )
)

 

 

 

 


My cumulation should be sorted by : 

'Unpivoted Bruch '[Materialkurztext], 'Unpivoted Bruch '[BruchType]

With 1 categoryWith 1 category 2.png

Any help is appreciated!

 

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @JANSAN ,

 

You can consider creating an Index to act as a top and bottom order for accumulation

Here are the steps you can follow:

1. In Power Query -- Add Column – Index Column – From 1.

vyangliumsft_0-1685937880557.png

2. Create measure.

Cumulative Total =
SUMX(
    FILTER(ALL('Unpivoted Bruch'),
    'Unpivoted Bruch'[Materialkurztext]=MAX('Unpivoted Bruch'[Materialkurztext])&&'Unpivoted Bruch'[BruchType]=MAX('Unpivoted Bruch'[BruchType])&&'Unpivoted Bruch'[Index]<=MAX('Unpivoted Bruch'[Index])),
    [AnzahlBruch(kg)])

3. Result:

vyangliumsft_1-1685937880560.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Your cumulation only works for one type of combined category (own cumulation for A1, for A2, A3....)
However I want to cumulate everything. So it should show the highest value first and then cumulate the number from there. So in your example data it should be (9+8+8+7+5......)

JANSAN
Frequent Visitor

I updated the post, with 2 pics

Mahesh0016
Super User
Super User

@JANSAN Please can share your ENDOUTPUT in Table and Dummy Data For more understanding.THANK YOU!!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

August Carousel

Fabric Community Update - August 2024

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