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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
PBandI
Frequent Visitor

Conditionally Formatting a Date Column

I am currently trying to format a date column based on if the date is in the past or if the date is blank. I am using a measure that I created for this and then passing it on to the conditional formatting for the column it should be applied to. If the date is in the past then the cell should be green, and if the date is blank then it should be red. The current measure I am using is shown below:

_HPA Status = IF(MAX('Opportunity'[HPA Signature Date]) < Today(), "Light Green" , "Light Red")

PBandI_2-1721165042568.png

 

The desired outcome is to have the cell that reads 12/27/2023 as green and all the other blank cells as red. Any help would be greatly appreciated!

 
 

 

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Hi! 
The issue with your DAX measure is that any dates that are BLANK are actually evaluated as 0 (which is less than today in DAX logic), so it will always show green. To fix it, you can add another condition to check if the value is blank:

_HPA Status = IF(MAX('Opportunity'[HPA Signature Date]) < Today() && NOT(ISBLANK('Opportunity'[HPA Signature Date])), "Light Green" , "Light Red")

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

Hi! 
The issue with your DAX measure is that any dates that are BLANK are actually evaluated as 0 (which is less than today in DAX logic), so it will always show green. To fix it, you can add another condition to check if the value is blank:

_HPA Status = IF(MAX('Opportunity'[HPA Signature Date]) < Today() && NOT(ISBLANK('Opportunity'[HPA Signature Date])), "Light Green" , "Light Red")

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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