Forum Discussion

olimilo's avatar
olimilo
Post Prodigy
7 years ago
Solved

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?

  • 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

     

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

     

     

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

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

     

    Hopefully this is what you are looking for.

     

    Regards,

    Tom

     

2 Replies