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
mcpato
Regular Visitor

Conditional Formatting based on Single Measure

Hi All,

 

I have a matrix table with several columns and rows.  The values are dynamic based on the code below as I had to apply different formats in the same table.

 

How do I apply conditional formatting when I have a single measure? For example, I would like to have Green Background with white font if Total Open $ is greater than Total Pipeline.

 

mcpato_0-1707426573395.png

mcpato_2-1707426640189.png

 

Thanks

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@mcpato , Based on what I got

 

Have a measure using the meausres

if([Total Open $] > [Total Pipeline], "Green", "red")

 

Same way create for font, use blank(), if you want default color

 

 

USe the above measures in conditional formatting using the field value option

 

You can create a complex measure using a switch

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi amitchandak,

 

Thanks for your help I was trying to replicate that but it seems the conditional formatting is highlighting the whole column. I have some filters applied to that table but it seems is not filtering by rows.

mcpato_0-1708497166909.png

This is my field value I'm using for conditional formatting. 

mcpato_1-1708497322816.png

mcpato_3-1708497760322.png

mcpato_4-1708497783627.png

mcpato_5-1708498129265.png

 

 

And I re defined the Switch Total Open $ measure: 

mcpato_2-1708497436631.png

 

Not sure why is not working, my guess is that the switch total open $ measure (needed for the different formats for the different columns) is causing the issue.

 

Hope you can help me!

 

 

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.