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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
evano_oruvan
Frequent Visitor

Conditional Formatting based on two columns

Capture.PNG

i want to create a conditonal formatting with background color for first customer priority ( we use direct query )

1. if currentAge < 60 and annualincome > 100,000 - priority should be green
2.if currentAge between 60 and 70 and annualincome between 60,000 and 100,000 - priority should be orange
3.if currentAge between > 70 and annualincome < 60,000 - priority should be red

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@evano_oruvan , Create color measure

 

Switch( True(),

[Current age measure]< 60 && [annualincome  Measure] > 100000, "Green",

[Current age measure] >= 60 && [Current age measure]< 70 && [annualincome  Measure] >60000 && [annualincome  Measure] <= 100000, "Orange",

[Current age measure] > 70 && [annualincome  Measure] < 60000 , "Red")

 

Use this in conditional formatting using field value option

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@evano_oruvan , Create color measure

 

Switch( True(),

[Current age measure]< 60 && [annualincome  Measure] > 100000, "Green",

[Current age measure] >= 60 && [Current age measure]< 70 && [annualincome  Measure] >60000 && [annualincome  Measure] <= 100000, "Orange",

[Current age measure] > 70 && [annualincome  Measure] < 60000 , "Red")

 

Use this in conditional formatting using field value option

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

thank you 🙂 mine is a calculated columns, i am unable to use the column, is there any workaround.
thanks

@evano_oruvan , You can create a calculated column, But it will take max or min color, based on row context. You have chosen min or max while defining conditional formatting

 

Switch( True(),

[Current age]< 60 && [annualincome] > 100000, "Green",

[Current age] >= 60 && [Current age]< 70 && [annualincome] >60000 && [annualincome Measure] <= 100000, "Orange",

[Current age] > 70 && [annualincome] < 60000 , "Red")

 

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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