Forum Discussion
ArchStanton
2 years agoPower Participant
OR Operator affecting my IF Statement
Does anyone know why and how to stop this code giving me a TRUE/FALSE in my calculated column? Validation to Closure = IF(ISBLANK('Cases'[applicationvalidationdate]),BLANK() || IF(ISBLANK('Cases...
- 2 years ago
Yes. If you have A || B, then the expected result is true/false.
Did you mean to write your measure like this:
Validation to Closure = IF ( ISBLANK ( 'Cases'[applicationvalidationdate] ) || ISBLANK ( 'Cases'[Resolution Date] ), BLANK (), DATEDIFF ( 'Cases'[applicationvalidationdate], 'Cases'[Resolution Date], DAY ) + 1 ) - 2 years ago
Hi,
The OR statement shouldn'e be an issue, might be the way it's worded with 2 If statements instead of just 1 with an OR. Try this:
Validation to Closure = if('Cases'[applicationvalidationdate] = BLANK()||'Cases'[Resolution Date]= blank(), BLANK(), DATEDIFF('Cases'[applicationvalidationdate],'Cases'[Resolution Date],DAY)+1)If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- 2 years ago
This is perfect - many thanks!
AlexisOlson
2 years agoSuper User
Yes. If you have A || B, then the expected result is true/false.
Did you mean to write your measure like this:
Validation to Closure =
IF (
ISBLANK ( 'Cases'[applicationvalidationdate] ) || ISBLANK ( 'Cases'[Resolution Date] ),
BLANK (),
DATEDIFF ( 'Cases'[applicationvalidationdate], 'Cases'[Resolution Date], DAY ) + 1
)
ArchStanton
2 years agoPower Participant
This is perfect - many thanks!