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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
PowerBINoob24
Resolver I
Resolver I

Multiple Colors for Conditional Formatting a Date Field

I currently have the following measure that I use to apply condition formating to a date field:
Approved Date Format = if( max('Execution Status'[Approved Date]) >max('Execution Status'[Due Date]),"red")
 
This works great; however, I need to modify it so that if the approved date is blank and the Due Date is greater than today's date, I need that field to be orange.  I've tried a few things, but I just get lost.
 
Thanks in advance for your help.
2 ACCEPTED SOLUTIONS

Hi , @PowerBINoob24 

I think the dax is right.

Switch ( True() ,

isblank(max('Execution Status'[Approved Date])) && max('Execution Status'[Due Date]) > today() , "orange" ,

max('Execution Status'[Approved Date]) >max('Execution Status'[Due Date]),"red"

)

Please confirm that your conditions are:
(1) [Approved Date]=BLANK and [Due Date]Show "orange" > TODAY()
(2) [Approved Date]> [Due Date] when showing "red"

 

For the conditions you give, it is not explicitly stated that [Approved Date] = BLANK() and [Due Date]<=TODAY() and so on.

For your question, you can give us some detailed example data and corresponding output sample data in tabular form so that we can better help you.

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

Not sure why switching the lines made a difference, but now it works.

 

Switch ( True() ,

max('Execution Status'[Approved Date]) >max('Execution Status'[Due Date]),"red",

isblank(max('Execution Status'[Approved Date])) && max('Execution Status'[Due Date]) < today() , "orange"

)

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@PowerBINoob24 , Try like

 

Switch ( True() ,

isblank(max('Execution Status'[Approved Date])) && max('Execution Status'[Due Date]) > today() , "orange" ,

max('Execution Status'[Approved Date]) >max('Execution Status'[Due Date]),"red"

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Not sure why switching the lines made a difference, but now it works.

 

Switch ( True() ,

max('Execution Status'[Approved Date]) >max('Execution Status'[Due Date]),"red",

isblank(max('Execution Status'[Approved Date])) && max('Execution Status'[Due Date]) < today() , "orange"

)

Unfortunately that didn't work.  The cells with the approved date populated will format red, but the cells that are blank and past due do not turn orange.

Hi , @PowerBINoob24 

I think the dax is right.

Switch ( True() ,

isblank(max('Execution Status'[Approved Date])) && max('Execution Status'[Due Date]) > today() , "orange" ,

max('Execution Status'[Approved Date]) >max('Execution Status'[Due Date]),"red"

)

Please confirm that your conditions are:
(1) [Approved Date]=BLANK and [Due Date]Show "orange" > TODAY()
(2) [Approved Date]> [Due Date] when showing "red"

 

For the conditions you give, it is not explicitly stated that [Approved Date] = BLANK() and [Due Date]<=TODAY() and so on.

For your question, you can give us some detailed example data and corresponding output sample data in tabular form so that we can better help you.

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.