Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamic Color based on value in a grid

I have a grid that displays different values in each row.  For one of the rows, I want the text to be dynamic based on the value.

 

 

Here is the DAX code that I use for the grid.  The Over/Under row is what I want to be dynamic.  For Ex: > 0, Red and < 0 Black.

 

SWITCH(
 TRUE(),
                HASONEVALUE(Bonus_Training_Lookup_Table[Budget Type])=FALSE," ",
  VALUES(Bonus_Training_Lookup_Table[Budget Type]) = "Bonus",FORMAT('Bonus - Actual'[Group Bonus Actual Non-Blank],"$0,000"),
  VALUES(Bonus_Training_Lookup_Table[Budget Type]) = "Bonus DL Base %",FORMAT('Bonus_Training_Lookup_Table'[Bonus Budget % DL Base],"Percent"),
  VALUES(Bonus_Training_Lookup_Table[Budget Type]) = "Over/(Under)",FORMAT('Bonus_Training_Lookup_Table'[Bonus Over_Under],"$0,000")
)

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    HI Anonymous,

     

    Nope, conditional formatting not support to direct use text value to format. Maybe you can consider to use format by field value(color name) or set up a rule of color formatting.

    Conditional formatting in tables

     

    Regards,

    Xiaoxin Sheng

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

     

    Nope, conditional formatting not support to direct use text value to format. Maybe you can consider to use format by field value(color name) or set up a rule of color formatting.

    Conditional formatting in tables

     

    Regards,

    Xiaoxin Sheng