Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Conditional formatting

Hi,

I have a measure Delta as follow:

Delta = SWITCH(
    TRUE(),
    [Hours_Submitted_TS] - [Hours_Forecast] > 0, "Charged more than expected",
    [Hours_Submitted_TS] - [Hours_Forecast] < 0, "Charged less than expected",
    [Hours_Submitted_TS] - [Hours_Forecast] = 0, "Charged as forecasted"
    )
 
I put this measure in a table and would like to change colors depending on the text.
Since this is not based on a field (also using 2 more measures9 , I don't see how to do it.
Thanks for your help.
LD
  • Hi Anonymous,

     

    You can use a measure to define the color like this:

    Delta Color= SWITCH(
        TRUE(),
        [Delta ] = "Charged more than expected", "RED",
         [Delta ] = "Charged less than expected", "YELLOW",
        [Delta ] = "Charged as forecasted", "GREEN"
        )

    Then go to Format Ribon and follow the path indicated by ChiragGarg2512., like this:

     

     

6 Replies

  • _AAndrade's avatar
    _AAndrade
    Resident Rockstar

    Hi Anonymous,

     

    You can use a measure to define the color like this:

    Delta Color= SWITCH(
        TRUE(),
        [Delta ] = "Charged more than expected", "RED",
         [Delta ] = "Charged less than expected", "YELLOW",
        [Delta ] = "Charged as forecasted", "GREEN"
        )

    Then go to Format Ribon and follow the path indicated by ChiragGarg2512., like this:

     

     

  • Go to Format Visual -> Cell Element -> Background Color -> Field[Format Style] -> Select the measure.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Well, nothing happens.

      I have

      Format style: Field value

      Apply To: Values only

      What field: Delta

      • _AAndrade's avatar
        _AAndrade
        Resident Rockstar

        You need to choose What field: Delta Color (the new measure)