Forum Discussion
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;
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()...)
2 Replies
- Greg_DecklerCommunity 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()...)
- eWiseHelper II
Thanks Greg_Deckler . That worked.