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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
lamlam24
Regular Visitor

Conditional Formatting on Values that are = 0, < 0 and > 0.

In my power bi report, I am trying to create a conditional formatting for values that meets the following conditions. 
if Value = 0 (green) 

if value > 0 (red)

if value < 0 (red). 

the matrix visual below is what I have in my report 

 

lamlam24_0-1714977760321.jpeg

Let's take a look at the 4 AM column. The measure for this column gives the following values
0, 0.1, -0.6 and 1.8. 
I want the background color for 0 to be green 

background color for 0.1 and 1.8 to be red 

background color for - 0.6 to be red. 

please help. 
thank you. 

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @lamlam24 

use below dax for conditional formatting


Color 4am= If(Sum( value)=0,"Green", If(sum(value)<0, "Red", "Yellow")
It gives you 3 color


but you have written red in both condition then formula would be this


Color 4am= If(Sum( value)=0,"Green", "Red")

 

then put this value under Cell element > background color

Uzi2019_0-1714979098062.png

 

 

then select fied the seect your measure

Uzi2019_1-1714979158478.png

 

 

I hope I answered you question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

2 REPLIES 2
Uzi2019
Super User
Super User

Hi @lamlam24 

use below dax for conditional formatting


Color 4am= If(Sum( value)=0,"Green", If(sum(value)<0, "Red", "Yellow")
It gives you 3 color


but you have written red in both condition then formula would be this


Color 4am= If(Sum( value)=0,"Green", "Red")

 

then put this value under Cell element > background color

Uzi2019_0-1714979098062.png

 

 

then select fied the seect your measure

Uzi2019_1-1714979158478.png

 

 

I hope I answered you question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
MNedix
Solution Supplier
Solution Supplier

Hi,

This should be quite easy and straight forward - see link below:

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting 

 

If this answered your question then please mark it as the solution so others can see it.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.