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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
eWise
Helper II
Helper II

IF Statement with blank dates

Hi all,

Can someone help me with this, 

Am trying to create an adjusted date based on the current date and time where when the time is past 1 pm, the adjusted date is the following day at 7 am. It works fine until where there is a blank date the it gives me really off date like below.

 

Hare is my if stsatement;

AdjustedDeliveryTime =
 
IF('Order'[PickedUpTime] > TIME(13,00,00), INT('Order'[delivered]) + 1 + TIME(7,0,0), 'Order'[delivered])
 
Here is a snapshot of what am getting. Notice the 1899 date. Thanks for the help.
 
eWise_0-1620162622401.png

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@eWise Right, DAX base reference date is midnight, 12/30/1899. Why? No idea, just is. So, BLANK() = 0 = 12/30/1899 00:00:00.

 

So, makes total sense what is going on. Try this:

 

 

AdjustedDeliveryTime =
IF(ISBLANK('Order'[delivered],BLANK(),IF('Order'[PickedUpTime] > TIME(13,00,00), INT('Order'[delivered]) + 1 + TIME(7,0,0), 'Order'[delivered]))

 

 

If you hate nested IF statements, use SWITCH(TRUE()...)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@eWise Right, DAX base reference date is midnight, 12/30/1899. Why? No idea, just is. So, BLANK() = 0 = 12/30/1899 00:00:00.

 

So, makes total sense what is going on. Try this:

 

 

AdjustedDeliveryTime =
IF(ISBLANK('Order'[delivered],BLANK(),IF('Order'[PickedUpTime] > TIME(13,00,00), INT('Order'[delivered]) + 1 + TIME(7,0,0), 'Order'[delivered]))

 

 

If you hate nested IF statements, use SWITCH(TRUE()...)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler . That worked.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors