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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MareRuiz
Regular Visitor

Dynamic counting for multiple hierarchies in Matrix Visual

Hi community,

I have  challenge:
I have a matrix with 5 hierarchies: Manufacturer, Signature, Brand, Sub_Brand, Franchise.

 

MareRuiz_5-1753187616927.png

MareRuiz_6-1753187662189.png



That look like this:

MareRuiz_1-1753183526489.png


And I want to count the rows occupied by each, something like this in a dynamic way:

MareRuiz_2-1753183705661.png

 

Or another option is to have the total rows that belong to each manufacturer as a rolling total like this:

MareRuiz_3-1753183848154.png

It has to be dynamic to the order of the Matrix visual, so if rows change their order, then the numbers should adjust:

MareRuiz_4-1753187535464.png


Thank you in advance for your help!

3 REPLIES 3
v-saisrao-msft
Community Support
Community Support

Hi @MareRuiz,

Thank you for reaching out to the Microsoft fabric community forum.

Thank you @FBergamaschi, for you insights.

I have recreated your scenario using sample data on my own. Please find the attached PBIX file for your reference.

vsaisraomsft_0-1753262660275.png

If you need any assistance, please let us know.

I hope this information is helpful.

 

Thank you.

 

Hi @v-saisrao-msft , 
Thank you for trying, however, the solution is not exactly what I'm looking for. I need something a little bit different:
The pink solution is a running total of the lines showing, at Manufacturer level. 

MareRuiz_0-1753294183275.png

The Red one is an enumeration of the lines.

@FBergamaschi I'll try with visual calculations. Can I use them to filter?

FBergamaschi
Solution Specialist
Solution Specialist

this is a prefect example to try for a visual calculation

 

Use CALCULATE and COUNTROWS together with the EXPAND/COLLAPSE functions

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

 

Documentation is here

 

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview

 

If this helped, please consider giving kudos and mark as a solution

@mein replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.