Forum Discussion

SaCvP125's avatar
SaCvP125
Frequent Visitor
8 years ago
Solved

Enter a background colour based on another column value

Hi guys,

 

I've the following table:

SLA DescriptionTarget_ValueResultFlag
Time to Respond80%83%1
Time to Resolution95%79%0

 

What I'm trying to do is when my Result Value is higher than Target_Value then the Background of Result field should be green otherwise show red.  I read somewhere that this isn't possible and the only way is to create another column that compares the value and then use the conditional formatting to put the colours. That's what I'm doing with column Flag.

 

My question is If I can use the value from Column to format the background of my Result column. So simples as this: if the Flag = 1 then the background of Result should be Green ELSE Red.

 

This is possible?

 

Many thanks
The column Flag compare the values above and if the Result is higher than Target_Value then i

  • Hi SaCvP125,

    As what you said, I create calculated column using the formula.

    Flag = IF(Table1[Result]>Table1[Target_Value],1,0)



    Then you create a visual, select all the fields needed to show. Right click the Flag column->Conditional formatting->Front color scales. Then set the minimum as 0, the maximum as 1. 

    conditional formatting for Flag columnSet the color of font in Flag
    You will get expected result as follows.



    Best Regards,
    Angelia

     

1 Reply

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi SaCvP125,

    As what you said, I create calculated column using the formula.

    Flag = IF(Table1[Result]>Table1[Target_Value],1,0)



    Then you create a visual, select all the fields needed to show. Right click the Flag column->Conditional formatting->Front color scales. Then set the minimum as 0, the maximum as 1. 

    conditional formatting for Flag columnSet the color of font in Flag
    You will get expected result as follows.



    Best Regards,
    Angelia