Forum Discussion

Gandarthvader's avatar
Gandarthvader
Regular Visitor
5 months ago
Solved

Conditional format date based on another date

Hello, I've found some similar suggestions to my issue, but nothing yet that has solved it. My appologies if I'm just missing something, but I have a table with a 2026 Due Date and 2026 Completion Da...
  • johnt75's avatar
    5 months ago

    You can use a measure like

    Cond formatting = IF(
        ISBLANK( SELECTEDVALUE( 'Table'[Completion Date] ) ),
        VAR CurrentDueDate = SELECTEDVALUE( 'Table'[Due Date] )
        VAR InNext30Days = CurrentDueDate >= TODAY() && CurrentDueDate <= TODAY() + 30
        VAR PastDue = CurrentDueDate < TODAY()
        VAR Result = SWITCH( TRUE(),
            PastDue, "red",
            InNext30Days, "yellow"
        )
        RETURN Result
    )

    and apply that as conditional formatting for the background for the due date.