cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ZiaAnderson
Helper II
Helper II

Need Help with Conditional Formatting

I have done basic conditional formatting before, but for some reason cannot get this one to work. I have this table (below).

The background color for cells in the Actual/Projected Obs column should be as follows:

Green if greater than 98% or less than or equal  100% of OSD GOAL

Yellow if greater than or equal 92% or less or equal 98% of OSD GOAL

Red if greater than or equal to 0% or less than 92% of OSD GOAL

 

So, the correct background colors should be:

Red

Red

Green

Yellow

Green

Green

Green

Green

Green

Green

Green

Green

 and I get something completely different. Maybe because it is using SUM? But I don't see any other option. Please help!

I guess it is worth noting that I am on Version: 2.72.5556.701 32-bit (August 2019) of Power BI.

ColorCoding1.JPG

 

1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@ZiaAnderson , Create a color measure and use that in conditional formatting with field value option

Switch(true(),
[OSD GOAL] >=.98 , "green", // use 98 if this not a % column
[OSD GOAL] >=.92 , "yellow",// use 92 if this not a % column
[OSD GOAL] >=0 , "red"
)

 

 

refer video or links for steps

https://www.youtube.com/watch?v=RqBb5eBf_I4

 

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

4 REPLIES 4
amitchandak
Super User IV
Super User IV

@ZiaAnderson , Create a color measure and use that in conditional formatting with field value option

Switch(true(),
[OSD GOAL] >=.98 , "green", // use 98 if this not a % column
[OSD GOAL] >=.92 , "yellow",// use 92 if this not a % column
[OSD GOAL] >=0 , "red"
)

 

 

refer video or links for steps

https://www.youtube.com/watch?v=RqBb5eBf_I4

 

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

@amitchandak  In your example you are just using [OSD GOAL], my measure would not allow me to use it like that. However, it allowed to use MAX. Could that be the problem?

Hi @ZiaAnderson 

 

In your data, all values from the [OSD GOAL] column are greater than .98 (the smallest one in image is 48039), so all the fields are green. This is a correct behavior. You need to put a measure whose result is percentage values between 0 and 1 to make this color measure work as you expected.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

@amitchandak , thank you very much for your reply! I watched the video and created the measure. However, now all the fileds are green. What am I doing wrong?

ColorCoding1.JPG

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors