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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SelvakumaranSKM
New Member

Rules on conditional formatting

Hi Experts,

 

In conditional formatting for data colours, Less than (<) and Less then equal to (<=) are not shown.

pls help to get different colour for values less than zero 

 

SelvakumaranSKM_0-1640242821437.png

Thanks

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @SelvakumaranSKM 

 

When you use Format by Rules, it requires a between range for every condition. This is by design currently. If you are sure that a very small negative value will not be reached in your case, you can set it as the start number of the range less than zero. For example, if value > -1000000 and < 0 then "color code".

 

Otherwise, if negative values are possible to reach very very small that you are not sure, you can use Format by Field Value. You can use DAX to create a measure to decide the colors, just like Amit suggested. You can use either Switch or If statement to create custom conditions. Here is an exmple with IF conditions Conditional formatting by field value in Power BI

 

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

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @SelvakumaranSKM 

 

When you use Format by Rules, it requires a between range for every condition. This is by design currently. If you are sure that a very small negative value will not be reached in your case, you can set it as the start number of the range less than zero. For example, if value > -1000000 and < 0 then "color code".

 

Otherwise, if negative values are possible to reach very very small that you are not sure, you can use Format by Field Value. You can use DAX to create a measure to decide the colors, just like Amit suggested. You can use either Switch or If statement to create custom conditions. Here is an exmple with IF conditions Conditional formatting by field value in Power BI

 

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

amitchandak
Super User
Super User

@SelvakumaranSKM , Because this first value, It is expected to between range.

 

Another way is to create a color measure and use that is conditional formatting using field value option

 

example

 

switch(true() ,
max(Table[status]) = "Completed" , "Green",
max(Table[status]) = "Running" , "Grey"
max(Table[status]) = "Errored" , "Red"
)

Switch( True() ,
[Percent] =1 , "Green"
[percent] <.75 , "red",
[percent] <.99 , "Yellow"
)

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.