Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Conditional formatting based on a dynamic value (slicer)

Hi guys,

 

so, basically every time I change my slicer, a new value is calculated (measure - it´s an avarage)

 

how do I make a conditional formatting based on this value that changes when I click in a differente slicer?

The ideia is to highlight the values above average for each region, but each region has a different avarage.

 

Hope I explained well :

13 Replies

  • Anonymous you can create another measure for KPI Color based on your mesure

     

    for example

     

    KPI Color = IF( [Measure] > 1, "Red", "Green" )

    and now you can use this KPI Color  measure on conditional formatting and color will change based on your original measure.

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi Anonymous 

    You can create a measure like below.

    Measure 
    INT( [COLUMN1] > [AVRAGE] ) 

    And use this measure for conditonal formating in your table

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

    • parry2k's avatar
      parry2k
      Super User

      Anonymous and make sure in conditional formatting, you choose Format by Field Value and then select KPI Color in drop down list

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      EDIT:

      Mariusz  i did it, but its not formatting. nothing happens.

       

      • Mariusz's avatar
        Mariusz
        Community Champion

        Hi Anonymous 

        Have you changed to "Format By" = Rules?

        Best Regards,
        Mariusz

        If this post helps, then please consider Accepting it as the solution.

        Please feel free to connect with me.
        Mariusz Repczynski


         

  • Anonymous's avatar
    Anonymous
    Not applicable

    parry2k  Mariusz  many thanks for helping.

     

    parry2k I created a new measure: If ( [ COLUMN1 ] > [AVERAGE MEASURE] ; "Red"; "Green" )

     

    but he is formatting all the cells green..

     

    Mariusz  your solution didn´t work out. PBI doesn´t allow me select your measure.

    • Mariusz's avatar
      Mariusz
      Community Champion

      Hi Anonymous 

       

      Sorry, you need to set my example like below.

       

      Best Regards,
      Mariusz

      If this post helps, then please consider Accepting it as the solution.

      Please feel free to connect with me.
      Mariusz Repczynski

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Mariusz  many thanks for the PBI File !! So, I tried to do the same but didn´t have the same result in my PBI file.. when I put the same measure you put, the result in the column was not 1 value.. there was a lot of differente values..

    SS below. the SLICER is affecting the measure, even with the ALLSELECTED() inside the calcute. 

     

    parry2k many thanks for the advice, I put my measure below.

     

    guys, thanks for helping, hope I´m not disturbing you.