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
yakovlol
Resolver I
Resolver I

Help with percentage in Matrix table with hierarchy

Hello! I have a matrix table with 3 levels of hierarchy (Department-Group - ID). And I need to calculate the percentage for each level of hierarchy but based on Types in a column in that matrix

 

My matrix 

yakovlol_0-1688142519832.png

 

Result I want to achieve

yakovlol_1-1688142606624.png

 

I tried different measures, but cannot achieve the correct percantage based on my hierarphy raws and columns.

 

pbix file

Really aprriceted for your help.

Thank you

 

  

1 ACCEPTED SOLUTION

Try this measure:

Measure 2 =
DIVIDE(
    SUM(Hours[Hours])
    ,CALCULATE(
        SUM(Hours[Hours])
        ,ALL(Hours[Type ])
        ,ALLEXCEPT(Departament, Departament[Departament])
    )
)


Luca D'Elicio

LinkedIn Profile

View solution in original post

16 REPLIES 16
Ashish_Mathur
Super User
Super User

Hi,

I am not clear about how you have calculated the % in the Pivot table screenshot.  Share the download link of the Excel file with the Pivot Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello @Ashish_Mathur . It's not a calculation in Excel file, in excel I just put the number for the desired picture that I want to achieve in PowerBi. So in Excel not the real calculations

I post a reply, have you seen it?



Luca D'Elicio

LinkedIn Profile
lucadelicio
Super User
Super User

Try to use the default Show value as - Percent of grand total.

On the field - select the arrow - Show value as - Percent of grand total.

lucadelicio_0-1688143060265.png

If you resolve your problem mark it as a solution.

Ciao!



Luca D'Elicio

LinkedIn Profile

Hello, @lucadelicio thanks for your reply. But it's not exactly what is needed. If I show the percent of GT I will have values like below 

yakovlol_0-1688152148536.png

But I need to have 100% in a row for each type (columns in the header)

 

I also attached link to pbix file, maybe it could help to understand more the issue.

Thank you

Thanks for the pbix.
Try if this measure is what you are looking for.

Measure =
var _htype =
CALCULATE(
    SUM(Hours[Hours])
    ,ALLEXCEPT(Hours, Hours[Type ])    
)
RETURN
DIVIDE(
    SUM(Hours[Hours])
    ,_htype
)

lucadelicio_0-1688154221991.png


I hope I have been helpful.
Mark it as a solution if resolve your problem.

Ciao!



Luca D'Elicio

LinkedIn Profile

Hi @lucadelicio thanks for your answer it's almost work as needed. But I need to have 100% in one line as well. I mean all types in columns should give me 100% in a line.

And we have 100%  only for the columns

yakovlol_0-1688307196099.png

Maybe do you have anu other sugestions? How can we achieve that?

Thank you)

pbix file

Please share the pbix.
Update the link it doesn't work.



Luca D'Elicio

LinkedIn Profile

Here it is) 
pbix file 

Try this measure:

Measure 2 =
DIVIDE(
    SUM(Hours[Hours])
    ,CALCULATE(
        SUM(Hours[Hours])
        ,ALL(Hours[Type ])
        ,ALLEXCEPT(Departament, Departament[Departament])
    )
)


Luca D'Elicio

LinkedIn Profile

@lucadelicio thanks for your approach. But with this measure, I indeed have 100% in line, but I missed now hierarchy under Department.

So now for Group 1, Group 2 etc that is under my Departments, we have 100% for each.

But ideally, it should take those 73.77% and divide it between groups and users based on hieraphy 

yakovlol_0-1688309879894.png

 

Maybe there are any other sugestions that could help to resolve it?

Thank you

lucadelicio_0-1688310400289.png

Is this what you want?



Luca D'Elicio

LinkedIn Profile

yes, indeed. Can you please share a file, or measure fo that?

it is written above....
Is measure 2....
Please mark as a solution.
Thank you



Luca D'Elicio

LinkedIn Profile

Thank you)

Alligator - Peaches 70% = is the result of what calculation?



Luca D'Elicio

LinkedIn Profile

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.