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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
manic2003
New Member

Trying to return True or False based on ISBLANK and DATEDIFF

Hi all,

 

I am trying to have a column populate with TRUE or FALSE based on another column "Owner" being blank AND the created time (of the service ticket) is greater than 4 hours.

 

I currently have this :-

 

SLA Compliant? = IF(AND(ISBLANK([owner]),(DATEDIFF([createddatetime],HOUR(NOW()),HOUR)>4)),TRUE,FALSE)

 

I receive no errors in the code but it i can see rows in my table that have a blank column and the difference in time between CreatedDateandTime and "now" is greater than 4 hours in these entries and so i expect a "True" but i only get "False" for everything!

 

Hopefully someone can help!

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@manic2003,

Please check if the following DAX returns your expected result.

SLA Compliant? = IF(AND([owner]="",(DATEDIFF([createddatetime],NOW(),HOUR)>4)),TRUE,FALSE)
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yuezhe-msft
Employee
Employee

@manic2003,

Please check if the following DAX returns your expected result.

SLA Compliant? = IF(AND([owner]="",(DATEDIFF([createddatetime],NOW(),HOUR)>4)),TRUE,FALSE)
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TBrowne
Advocate I
Advocate I

Have you tried it without the "HOUR" on the NOW function? I believe the issue is there. 

Hi TBrowne.... Yes unfortunately i had tried it with and without and it is the same result....

Ok. Have you added a column with only the DATEDIFF for debugging purposes? It must not be calculating that part correctly, maybe try with and without the HOUR on the NOW function on the debugging column as well. 

Hi Tbrowne it appears that ISBLANK is the problem and when i do Lydia's suggesting of " " then it works fine!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.