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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
renecornish
Regular Visitor

Conditional Formatting

Hey, I need some help with conditional formatting.  I have two measures, one TARGET and the other the actual MEASURE.  I am wanting to change the colour of the bar to GREEN if the measure was achieved and RED if not.  How would I go about doing this?

I would presume under Data colours, but there is no options there?

5 REPLIES 5
renecornish
Regular Visitor

What I ended up doing which worked well was creating 2 measures...

  1. Green = IF(SUM([MEASURE])<=SUM([TARGET MEASURE]),SUM(MEASURE]),0)
  2. RED = IF(SUM([MEASURE])>SUM([TARGET MEASURE]),SUM(MEASURE]),0)

This way I was able to do conditional formatting on these results.

v-lili6-msft
Community Support
Community Support

hi  @renecornish 

If you put two or more measure into one chart visual, you could not use conditional formatting any more.

 

so when you just use one measure then you could add a new measure like this: Measure = if([ACTUAL] >= [TARGET] , "Green","Red")

then use it to conditional format it.

 

if you still have the problem, please share your sample pbix file and your expected output.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@renecornish , Create a color measure and use that in conditional formatting using "Field Value" Option

 

Measure = if([ACTUAL] >= [TARGET] , "Green","Red")

 

refer for steps

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

 

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

What I ended up doing which worked well was creating 2 measures...

  1. Green = IF(SUM([MEASURE])<=SUM([TARGET MEASURE]),SUM(MEASURE]),0)
  2. RED = IF(SUM([MEASURE])>SUM([TARGET MEASURE]),SUM(MEASURE]),0)

This way I was able to do conditional formatting on these results.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.