Forum Discussion

Jansco's avatar
Jansco
Helper I
7 years ago
Solved

Page filter with conditional formatting

Is it possible to create a page filter for a table that conditionally formats a field? The user would be able to choose a value and all values below their selected value would turn red.
  • Hi Jansco ,

     

    We can create a measure as below and set conditional formatting based on it.

     

    Measure = IF(MAX(Parameter[Parameter]) > MAX('Table'[value]),"#FF000F",BLANK())

     

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Yes. I actually do exactly this in my upcoming book, Learn Power BI from Packt publishing. (Sorry, not out until September). The trick is to first use a What If measure. Once you have that, you can create another measure to base your conditional formatting on. Basically use MAX or SELECTEDVALUE to grab the value of your slicer and compare it with the other value you have in the current context. Return something like 1 if higher and 0 if lower. Define your conditional formatting rules on this measure.

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi Jansco ,

     

    We can create a measure as below and set conditional formatting based on it.

     

    Measure = IF(MAX(Parameter[Parameter]) > MAX('Table'[value]),"#FF000F",BLANK())