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
shainis
Helper I
Helper I

DATEDIFF help

Hi,

 

I'm trying to calculate DATEDIFF but getting weird results... I would like to see in "Column" 1.5, 1.5, 2, 1.5 etc.

I'll appreciate your help with that.

Thanks!

 

3212321.JPG

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @shainis

 

A few questions:

Can you share the pbix? Are [EndDate] and [EventDate] measures? Can you show their code?

Is what you want to calculate a column or a measure?

 

In the meantime, try this instead:

     ([EndDate] - [EventDate]) * 24

 

which should yield the difference in hours

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @shainis

 

A few questions:

Can you share the pbix? Are [EndDate] and [EventDate] measures? Can you show their code?

Is what you want to calculate a column or a measure?

 

In the meantime, try this instead:

     ([EndDate] - [EventDate]) * 24

 

which should yield the difference in hours

Thanks, @AlB, that worked!

 

An alternative solution would be to use the Time Subtruct. Both are doing the job.

Thank you!

 

 גגדדששד.JPG

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.