Forum Discussion

Sean-OReilly's avatar
Sean-OReilly
Icon for Helper IV rankHelper IV
3 years ago
Solved

How Do I Conditional Format a Date to go Red if before Today's date?

Hi How Do I Conditional Format a Date to go Red if before Today's date?   Here is my sample data - If End Date is before Today, i want it to go Red.  
  • Anonymous's avatar
    Anonymous
    3 years ago

    You can create a measure like this 

     

     

     

     

    Colour_Date = 
    VAR date_diff = DATEDIFF(TODAY(), MAX('Table'[End_Date]), DAY)
    RETURN
        IF (date_diff < 0, "#C81517")

     

     

     

    and then apply it as a conditional format to the column. The "#C81517" is HEX code so can be changed to a different red if you want

    Post edited to correct table reference in the measure