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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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