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
Milozebre
Helper V
Helper V

Condition with Datediff

 

Hello,
I have a problem with datediff.
I have 2 columns with dates (date 1 and date 2) in the format dd / mm / yyyy HH: MM.
theoretically date 2 is always larger than date 1. But I have exceptions.
Datediff (Date 1, Date2, Hour) does not work because I have the case.
I would like to make a condition: if date1> date 2 then we will have the resutat "null" otherwise datediff (date1, date2, hour)

thx

1 ACCEPTED SOLUTION
Milozebre
Helper V
Helper V

Hi Communauty, 

 

Thank you for your help. I tried for several days, different formulas but always the same results.

Queries in SQL were working. So I left 1-2 days to think. And when I got back to this problem, I found that I put the formule in a calculated column.

By doing a measure with a formula, it works.

 

I'm sorry about the hassle 🙂

 

Thanks again for the help.

View solution in original post

11 REPLIES 11

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.