Forum Discussion

PabloGiraldo's avatar
PabloGiraldo
Helper IV
5 years ago
Solved

Traffic Light Dates

Hi,

 

I would like a column that turns red, yellow, green if today's date is within 0-45 days, 46-60 days, 61+ days, respectively. 

 

See attached screenshot for reference.

 

Thank you,

Pablo

  • themistoklis's avatar
    themistoklis
    5 years ago

    Hello PabloGiraldo ,

     

    You should add the column in table 'Submittals'.

    The formula to use will be the following:

     

    Column Color = SWITCH(TRUE(),
    DATEDIFF(Submittals[Required date],TODAY(),DAY)  <=45,"#FF0000",
    DATEDIFF(Submittals[Required date],TODAY(),DAY)   >45 && DATEDIFF(Submittals[Required date],TODAY(),DAY)   <=60,"#FFFF00",
    DATEDIFF(Submittals[Required date],TODAY(),DAY)   >60,"#00B050")

     

     

    I have also attached the file with the color coding applied to field Manager in the table

4 Replies

  • themistoklis's avatar
    themistoklis
    Community Champion

    PabloGiraldo 

     

    You can create a column and add the following formula:

     

    Column Color = SWITCH(TRUE(),
    DATEDIFF(Combined_Table[Date],TODAY(),DAY)  <=45,"#FF0000",
    DATEDIFF(Combined_Table[Date],TODAY(),DAY)   >45 && DATEDIFF(Combined_Table[Date],TODAY(),DAY)   <=60,"#FFFF00",
    DATEDIFF(Combined_Table[Date],TODAY(),DAY)   >60,"#00B050")

     

     

    To display the colours in cells for the field that you require, go to conditional formatting and select format by: Select the Color Column