Forum Discussion
DAX - Date variable with blanks
1) Check if the Off Rail date happened before the Rail Arrived
2) Check if one of those values is BLANK
3) I'm having an issue regarding when these two dates are the same because if they are the same it's OK, but my formula does not return it, I wonder if the problem is at the less than or equal operator when I compare the dates between these two columns
I've created a formula, but I'm not sure if it is in the proper context. I'd appreciate it if someone could take a look at it:
- Anonymous2 years ago
So I tried but it still didn't solve the problem of the same dates, but your idea helped me to implement this new formula, I run some tests and apparently it is working now, thanks for the help tamerj1
RAIL ARVD > OFF RAIL =VAR SEBLANK = IF(ISBLANK(Plan[Rail Arrived]), "CHECK","OK")VAR SEDATA = IF(INT(DATEDIFF(Plan[Rail Arrived], Plan[Off Rail],DAY)) > 1, "CHECK","OK")VAR FINAL = IF(OR(SEBLANK = "CHECK", SEDATA = "CHECK"),"CHECK", "OK")RETURNFINAL
3 Replies
- tamerj1Community Champion
Hi Anonymous
please try
=
IF (
Plan[Rail Arrived] = BLANK (),
"Check",
IF ( INT ( Plan[Off Rail] - Plan[Rail Arrived] ) >= 1, "Ok", "Check" )
)- AnonymousNot applicable
So I tried but it still didn't solve the problem of the same dates, but your idea helped me to implement this new formula, I run some tests and apparently it is working now, thanks for the help tamerj1
RAIL ARVD > OFF RAIL =VAR SEBLANK = IF(ISBLANK(Plan[Rail Arrived]), "CHECK","OK")VAR SEDATA = IF(INT(DATEDIFF(Plan[Rail Arrived], Plan[Off Rail],DAY)) > 1, "CHECK","OK")VAR FINAL = IF(OR(SEBLANK = "CHECK", SEDATA = "CHECK"),"CHECK", "OK")RETURNFINAL - AnonymousNot applicable
Oh thanks, I'll try it