Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Gandarthvader
Regular Visitor

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 Date column. Both have dates listed. 

 

I'd like to have cells with a 2026 Due Date that is within the next 30 days to show up with a yellow back ground, or if it the 2026 Due date is past due then give it a light red background; only if the 2026 Completion Date is cell is blank.

 

But if the 2026 Completion Date is filled out I would like it to ignore the color rules in the 2026 Due Date column and have no background color since it is completed.

 

The format of the table columns are as follows: 'API Worksafe'[2026 Due Date] and 'API Worksafe'[2026 Completion Date]

 

I've attached a screenshot of the current table for a visual and marked the 2 columns that I'm working with in this question. 

 

Thank you for any help!!!

 

Gandarthvader_0-1771859324194.png

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

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.

View solution in original post

2 REPLIES 2
Gandarthvader
Regular Visitor

You are awesome! That worked like a charm. Thank you so much!!

johnt75
Super User
Super User

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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.