cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
lululady Frequent Visitor
Frequent Visitor

Running Total from One Category to the Next in a Matrix Column

Hello -

How do I do this? I cannot figure it out. I need a running total down a column by parent categories. They need to build on one another. Category 1 is worst case. Category 2 is better case (results from 1+2) and Category 3 is even better case (1+2+3).

 

Example below:

 

Example.JPG

3 REPLIES 3
Community Support Team
Community Support Team

Re: Running Total from One Category to the Next in a Matrix Column

hi, @lululady

After my reseach, you could try this way as below:

Step1:

Create a Dim Level table for category like this:

1.JPG

Step2:

Create a relationship like this:

2.JPG

Step3:

create a measure by this formula

Measure = CALCULATE(SUM(Table1[Value]),FILTER(ALL('Dim Level'),'Dim Level'[Level]<=MAX('Dim Level'[Level])))

Drag category field from dim level table and set Format->Values->show on rows

3.JPG

Result:

4.JPG

 

Best Regards,

Lin

 

 

 

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lululady Frequent Visitor
Frequent Visitor

Re: Running Total from One Category to the Next in a Matrix Column

@v-lili6-msft 

Hello -

Thank you for getting back to me. Unfortunately, I tried this but it did not give me the resulet I needed. I do not see any subcategories? 

Here is another example below - animal total is added to reptile total is added to bird total.

Capture.JPG

 

Community Support Team
Community Support Team

Re: Running Total from One Category to the Next in a Matrix Column

hi, @lululady

You could try this way:

Step1:

Create a Dim Level table for Category like this:

11.JPG

Note: you could use Sort by column in Power BI Desktop for the sort in visual

(select Category field then click Modeling->Sort by Column->Level)

12.JPG

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

Step2:

Use this formula to add a measure

Measure = CALCULATE(SUM(Table1[Weight]),FILTER(ALL('Dim Level'),'Dim Level'[Level]<=MAX('Dim Level'[Level])))

Step3:

Add a matrix visual like this

13.JPG

Step4:

Drag Weight filed into visual level filter and setWeight is not blank.

14.JPG

Result:

15.JPG

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 147 members 1,884 guests
Please welcome our newest community members: