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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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