Forum Discussion

poli361's avatar
poli361
Helper I
2 years ago
Solved

Dynamic Conditional Formatting based on SELECTEDMEASURE()

Hi I am trying to get a Font rule that works for every Calculation without using conditional format style "Rules" and applying them to every calculation . 

 

I am using a code like that so I can choose "Field Value" and then this dax measurement

Diff Font = var calc=SELECTEDMEASURE()

var result=if(calc > 0,"Green",if(calc<0,"Red","White"))
RETURN calc

I cant get it right though . Do you know if there is a problem when using SELECTEDMEASURE() in Conditional Formatting .
Thank you a lot in advance
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi poli361 ,

     

    I seem to understand your needs. You want to set the font in the matrix, but the measures in your matrix are replaced or you have multiple measures, but you don't want to re-modify the conditional formatting because of the replacement, or repeatedly set the conditional formatting.

    I'm sorry, it is currently unavailable. You need to erpeat steps each measure you want to apply conditional formatting to.

    Maybe you could submit an idea for this:

    Ideas (microsoft.com)

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi poli361 ,

     

    I seem to understand your needs. You want to set the font in the matrix, but the measures in your matrix are replaced or you have multiple measures, but you don't want to re-modify the conditional formatting because of the replacement, or repeatedly set the conditional formatting.

    I'm sorry, it is currently unavailable. You need to erpeat steps each measure you want to apply conditional formatting to.

    Maybe you could submit an idea for this:

    Ideas (microsoft.com)

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

  • I believe you still have to go into conditional formating and choose "Field Value" for the Format Style and your measure with the color data in the "What Field should be base this on"

     

    • poli361's avatar
      poli361
      Helper I

      Thats not the solution I am trying to get . I need to create a measurement to work on any measurement I put on my visual , that's why I am calling SELECTEDMEASURE() . It seems that it doesn't work .

  • Conditional formating done at column level.  The only way this would work is if your data all came from a pivot table

     

    example:


    Measure:

    Color =
    Var Color_ = if(SELECTEDVALUE(ColorT[Value])>5,"Green")
    return Color_

     

     



    • poli361's avatar
      poli361
      Helper I

      Thank you for replying . I just want to make one measurement to work on any measurement I put . 
      In your example you are using one column "ColorT[Value]" , but I want to use a dynamic column , which will be whatever I put inside the matrix table .