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! Request now

Reply
ArchStanton
Impactful Individual
Impactful Individual

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'[Resolution Date]),BLANK(),
                        DATEDIFF('Cases'[applicationvalidationdate],'Cases'[Resolution Date],DAY))+1)

 

It is something to do with the || (OR) operator because without the || there is no TRUE/FALSE only a DATEDIFF Count.

 

IF(ISBLANK('Cases'[applicationvalidationdate]),BLANK(),
                        DATEDIFF('Cases'[applicationvalidationdate],'Cases'[Resolution Date],DAY))+1

 

Thanks

3 ACCEPTED SOLUTIONS
AlexisOlson
Super User
Super 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
)

View solution in original post

DOLEARY85
Resident Rockstar
Resident Rockstar

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)
 
DOLEARY85_0-1708447267499.png

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

This is perfect - many thanks!

View solution in original post

4 REPLIES 4
DOLEARY85
Resident Rockstar
Resident Rockstar

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)
 
DOLEARY85_0-1708447267499.png

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Thanks for the quick reply - that works!

AlexisOlson
Super User
Super 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
)

This is perfect - many thanks!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors