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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mdebekke
Advocate I
Advocate I

Conditional formatting matrix percent of row total

When creating a Matrix visual , I would like to know the percentage of recharge per resource. In my Data these values are hours (whole numbers). In the Matrix I turn these hours into percent of row total to have percentage values per resource. After doing that I can't conditional format on these percentages. (see screenshot). I would like to have red color when Yes value is below 86% and green if 86% or above. Someone here who has a bypass for that via some code?

 

Someone already have added this as idea to solve in next updates if voted enough Smiley Happy

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/14475942-conditional-formatting-f...

 

Matrix visual.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mdebekke

 

Why don't you try creating measures as I have mentioned below for Yes % and No %.

 

1. Create measures

Yes % = CALCULATE(SUM(Table[YesHours])/(SUM(Table[YesHours]) + SUM(Table[NoHours])))

No % = CALCULATE(SUM(Table[NoHours])/(SUM(Table[YesHours]) + SUM(Table[NoHours])))

 

2. Convert datatype of these measures to % using the modelling tabimage.png

3. Use the measures in the matrix as in the above screenshot

 

4. You can use conditional formatting property available for matrix and set the color for any column as per the range conditionsimage.png

This should serve your purpose!

Do try this approach and accept as solution if it works..and let me know in case of any queries! 

 

 

 

Thanks,

Suguna.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @mdebekke

 

Why don't you try creating measures as I have mentioned below for Yes % and No %.

 

1. Create measures

Yes % = CALCULATE(SUM(Table[YesHours])/(SUM(Table[YesHours]) + SUM(Table[NoHours])))

No % = CALCULATE(SUM(Table[NoHours])/(SUM(Table[YesHours]) + SUM(Table[NoHours])))

 

2. Convert datatype of these measures to % using the modelling tabimage.png

3. Use the measures in the matrix as in the above screenshot

 

4. You can use conditional formatting property available for matrix and set the color for any column as per the range conditionsimage.png

This should serve your purpose!

Do try this approach and accept as solution if it works..and let me know in case of any queries! 

 

 

 

Thanks,

Suguna.

To solve this to get the measures into my file I created 2 custom columns via "edit queries" with below formula, because I had 1 hours column:

 

=  if Text.Contains([RECHARGE], "YES") then [Hours] else 0)

=  if Text.Contains([RECHARGE], "NO") then [Hours] else 0)

 

This solved combined with your solution my challenge 🙂

 

Thanks!!!

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.

Top Solution Authors