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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Josh1994
Helper II
Helper II

Need help - Comparing two dates (or blank data)

Hi!

 

I am trying to make a new column based on two others.

Essentially, it is checking that the "actual completed date" is less than or equal to the target date.

 

The bit im having an issue with, is i also need it to flag up if there is no data in the Actual completed date field, and the target completed date is after todays date.

I include a small photo to help visualise what i am trying toa chieve

 

As always, I appreciate any advice you are able to give me


Thank you for reading!

 

Josh

 

 

Josh1994_0-1659706444810.png

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Josh1994,

 

Try this calculated column:

 

Compliance = 
VAR vToday =
    TODAY ()
VAR vResult =
    SWITCH (
        TRUE,
        NOT ISBLANK ( Table1[Actual Completed date] ), IF ( Table1[Actual Completed date] <= Table1[Target date], "Yes", "No" ),
        ISBLANK ( Table1[Actual Completed date] ) && Table1[Target date] > vToday, "Yes", "No"
    )
RETURN
    vResult

 

DataInsights_0-1659807176569.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
DataInsights
Super User
Super User

@Josh1994,

 

Try this calculated column:

 

Compliance = 
VAR vToday =
    TODAY ()
VAR vResult =
    SWITCH (
        TRUE,
        NOT ISBLANK ( Table1[Actual Completed date] ), IF ( Table1[Actual Completed date] <= Table1[Target date], "Yes", "No" ),
        ISBLANK ( Table1[Actual Completed date] ) && Table1[Target date] > vToday, "Yes", "No"
    )
RETURN
    vResult

 

DataInsights_0-1659807176569.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks, this was a very useful measure.

Thank you for taking the time out!

 

Appreciate all the help 🙂 @DataInsights 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.