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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
olimilo
Responsive Resident
Responsive Resident

Conditional formatting rule without a ceiling (max) or floor (min) value

 

Is there any way I can set a greater than only rule for a conditional formatting?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

unfortunately it's not possible using the rule based conditional formatting but it can be easily achieved using the field based formatting. For this create a measure like so:

vizAid background = 
var currentValue = CALCULATE(SUM('Fact Sale'[Quantity]))
return
SWITCH(TRUE()
    , currentValue < 115000, "coral"
    , currentvalue >= 115000 && currentValue < 600000 ,"#FFFF00"
    , "lime"
)

As you can see, you can either use named colors or a valid hexcode, this article reflects on the named colors that are supported from Power BI: https://blog.crossjoin.co.uk/2018/08/10/colour-names-supported-in-power-bi-conditional-formatting/

 

To assign the measure to the table or matrix visual (basically you can use this coloring on any visual that supports a "fill color" like bar charts) just follow these two steps:

 

1. Select the background color option from the conditional formatting dialog

image.png

 

2. Choose the measure for the Field value based formatting:

 

image.png

 

Then you get a table / matrix visual that will look this:

image.png

Currently it's not possible to bring the conditional formatting to Total line.

 

Hopefully this is what you are looking for.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

TomMartens
Super User
Super User

Hey,

 

unfortunately it's not possible using the rule based conditional formatting but it can be easily achieved using the field based formatting. For this create a measure like so:

vizAid background = 
var currentValue = CALCULATE(SUM('Fact Sale'[Quantity]))
return
SWITCH(TRUE()
    , currentValue < 115000, "coral"
    , currentvalue >= 115000 && currentValue < 600000 ,"#FFFF00"
    , "lime"
)

As you can see, you can either use named colors or a valid hexcode, this article reflects on the named colors that are supported from Power BI: https://blog.crossjoin.co.uk/2018/08/10/colour-names-supported-in-power-bi-conditional-formatting/

 

To assign the measure to the table or matrix visual (basically you can use this coloring on any visual that supports a "fill color" like bar charts) just follow these two steps:

 

1. Select the background color option from the conditional formatting dialog

image.png

 

2. Choose the measure for the Field value based formatting:

 

image.png

 

Then you get a table / matrix visual that will look this:

image.png

Currently it's not possible to bring the conditional formatting to Total line.

 

Hopefully this is what you are looking for.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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