cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rachaelwalker
Resolver II
Resolver II

Date1 greater than Date 2 formula

I am looking for help with my DAX formula to show if Install Date > Ship Date then flag it as a 1 otherwise 0. Currently, I am using the formula below but I don't want it to calculate for products with no ship dates. 

 

Past Due Flag = IF('IV_Product'[Install Date] > 'IV_Product'[Ship Date], 1, 0)

 

rachaelwalker_2-1632166997075.png

 

 

 

2 ACCEPTED SOLUTIONS
edhans
Super User
Super User

Try this @rachaelwalker 

Past Due Flag =
IF(
    ISBLANK( 'IV_Product'[Ship Date] ),
    BLANK,
    IF(
        'IV_Product'[Install Date] > 'IV_Product'[Ship Date],
        1,
        0
    )
)

If ShipDate is blank, it returns blank, otherwise it does your normal  1/0 result.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

Just a small thing you missed is that you didn't add parenthesis after BLANK. It Should be BLANK().

Everything else is correct.

View solution in original post

3 REPLIES 3
edhans
Super User
Super User

Try this @rachaelwalker 

Past Due Flag =
IF(
    ISBLANK( 'IV_Product'[Ship Date] ),
    BLANK,
    IF(
        'IV_Product'[Install Date] > 'IV_Product'[Ship Date],
        1,
        0
    )
)

If ShipDate is blank, it returns blank, otherwise it does your normal  1/0 result.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Just a small thing you missed is that you didn't add parenthesis after BLANK. It Should be BLANK().

Everything else is correct.

@Aditya_Meshram @edhans  Thank you both! 

 

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors