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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Arranafc19
Helper IV
Helper IV

Calulcate Total Time difference between two datetimes

Hi ,

 

I am working on a measure which calculates the total time difference between datetime columns in power bi.

 

I am using the below custom column to get this but my issue is that this creates a text type column which will not allow me to sum.

 

=Duration.ToText([AlarmClearedUTC]-[AlarmSentUTC])

 

Is there a way to get the time difference between datetimes which will then allow me to sum this up in a measure ?

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Arranafc19 ,

 

You can use "datediff" function for calculation.

 

Here is the reference:

https://dax.guide/datediff/

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Arranafc19 ,

 

You can use "datediff" function for calculation.

 

Here is the reference:

https://dax.guide/datediff/

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
harshnathani
Community Champion
Community Champion

Hi @Arranafc19 ,

 

 

You can try these solutions

 

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

https://community.powerbi.com/t5/Desktop/Calculate-Hours-between-dates-for-only-business-hours/td-p/...

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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