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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Benjamin24
Frequent Visitor

How to get percentage of subtotal in a matrix ?

Hello everybody,

 

In power BI desktop I would like to get the porcentage of subotals for rows and lines. 

 

Here is my matrix : 

Benjamin24_0-1741861495767.png

I have my hours for lines, week day for columns and the count of my tickets as a value, I activate subtotal for columns and lines( in the format parameters of the matrix) and I would like to add one columns and one line(or add the percentage directly with the subttotal column and line) with the percentage for my subtotal compare to the general total. How can I do to add only one column and one line for the subtotal ? thank you

 

1 ACCEPTED SOLUTION
Deku
Community Champion
Community Champion

You can't do this with native visuals. You'd have to look at Deneb or some other custom visual 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

7 REPLIES 7
Benjamin24
Frequent Visitor

But with those measures I get de percentage for each columns(monday,tuesday etc) and I would like to get the percentage only for subtotal, how can I do that ? thank you in advance

Deku
Community Champion
Community Champion

Var grandtotal= 

Calculate([Measure], Allselected())

Return

If( 

( Not Isinscope(table[month])  && isinscope(table[hour])) || 

( Isinscope(table[month])  && not isinscope(table[hour])),

Format(

Divide([Measure], grandTotal),

"#%"

),

[Measure]

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

I get the good result but as the other solutions, I have one column for each days and I want only one column for my total, how can I choose the display of the columns ? thanks

Deku
Community Champion
Community Champion

Can you share a image of what you want it to look like


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Benjamin24_0-1741874703113.png

Something like with all sub percentage for the total of axis Y and the same for the the subtotal of axix X

Deku
Community Champion
Community Champion

You can't do this with native visuals. You'd have to look at Deneb or some other custom visual 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
bhanu_gautam
Super User
Super User

@Benjamin24 Create measures

 

TotalTickets = SUM('YourTable'[TicketCount])

SubtotalTickets = SUMX(ALLSELECTED('YourTable'), 'YourTable'[TicketCount])

PercentageOfTotal = DIVIDE([SubtotalTickets], [TotalTickets], 0)

 

Add the PercentageOfTotal measure to your matrix, and it will display the percentage of each subtotal compared to the total. This approach ensures that you have a dynamic calculation that respects the context of your matrix, showing the correct percentages for both rows and columns




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors