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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors