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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.