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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply

Compute percenteage of total by each category in matrix table

Hi,

 

I am trying to replicate a pivot table like this in power BICapture.PNG

 

This is what I have achieved so far with the Matrix table and it does not really work because I cannot compute the percentage of total for each status by each Source (For example, ATP has 7 leads on 13/05/2020 and 4 leads were approved, then the percentage for approved under ATP should be 57% not 7.27% like in the picture) , it only has the percentage of row, percentage of column and percentage of grand total which are not really what I want, please help me with this case, thank you!

Untitled.png

1 ACCEPTED SOLUTION

My bad, try this:

Measure = 
IF( Hasonefilter([Status]) ;
Calculate([Lead count] ; Removefilter([Status])) ; 
Calculate([Lead count] ; Removefilter([Source]) , [Source] <> BLANK() , [Source] <> "Delivered")

 


Connect on LinkedIn

View solution in original post

12 REPLIES 12
amitchandak
Super User
Super User

@natureorigin01 , Not clear. There is % of total you can use for every column.

Or refer

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi,

 

I have found a way to compute the percentage of each Status under each Source, but now the percentage of each Source is 100%,

I need it to be the percentage of the column total, please advise if you can, thank you!

 

https://ibb.co/PzP1Cpz

Hi, 

I'd advice you to start by creating a measure counting to total count per source. 

It should look something along the lines of:

Measure = Calculate([Lead count] ; Removefilter([Status]))


And when you place it in the matrix it should return something along the lines of:

approved

4 7
busy   7
callback consult   7
closed   7
rejected 2 7
trash 1 7


You should then finally be able to use this measure in a divide with [lead count] to get the correct %. 

Let me know how it goes,

/ J


Connect on LinkedIn

Hi,

 

Thanks for your reply,

 

I tried the methods and it returned the percentage for the statuses under the source but the percentage of the source is now 100%, I need it to be the percentage of the column total, is there anyways to achieve this?

 

Capture.PNG

Try this, 

Measure = 
IF( Selectedvalue([Status]) <> BLANK();
Calculate([Lead count] ; Removefilter([Status])) ; 
Calculate([Lead count] ; Removefilter([Source])) 


/ J

 


Connect on LinkedIn

Thanks for your reply,

 

I tried the suggested code but it returned some weird numbers, not the column total, for example on 13 May 2020, the column total is 559 but it returned 1675

Capture.PNG

Do you have any visual level filters on the table that affect the "Source" column? 


Connect on LinkedIn

Capture.PNGYes, I have put a filter to not include 'Delivered' and Blank Sources

Measure = 
IF( Selectedvalue([Status]) <> BLANK();
Calculate([Lead count] ; Removefilter([Status])) ; 
Calculate([Lead count] ; Removefilter([Source]) , [Source] <> BLANK() , [Source] <> "Delivered") 


/J


Connect on LinkedIn

Thanks for your reply, 

 

Now I have removed all the filters but the blank Source and some other Sources like ELB and EVC are not showing the correct total, is there anyways to fix this?

 

Capture.PNG

My bad, try this:

Measure = 
IF( Hasonefilter([Status]) ;
Calculate([Lead count] ; Removefilter([Status])) ; 
Calculate([Lead count] ; Removefilter([Source]) , [Source] <> BLANK() , [Source] <> "Delivered")

 


Connect on LinkedIn

It worked! 

Thanks so much!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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