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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Pick
Helper II
Helper II

Get duration in hours minutes and seconds bewteen start and end columns

Hi

 

See below how can I add a new column to show the different between start date and end date in table below.  Duration needs to be in hours, minutes and seconds.

 

Duration Power BI.JPG

  Thanks

 

   Ian

1 ACCEPTED SOLUTION
kentyler
Solution Sage
Solution Sage

You will need a measure or a calculated column.

You can use DATEDIF() to get the difference in minutes, like this

 DATEDIFF ( 'prod agenttask'[TaskStartTime].[Date], 'prod agenttask'[TaskEndTime].[Date], SECOND)

and once you have the number of seconds you can do simple math to figure out how many hours/minutes/seconds that is using the MOD() function. First figure out how many hours you have and then operate on the remainder to figure out your minutes, and then again on the remainder to figure out your seconds.

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Pick ,

 

Do you mean to get the time data like "hh:mm:ss"?

3-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

Refer

https://community.powerbi.com/t5/Desktop/Calculate-difference-between-two-dates-power-query/td-p/623...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
kentyler
Solution Sage
Solution Sage

You will need a measure or a calculated column.

You can use DATEDIF() to get the difference in minutes, like this

 DATEDIFF ( 'prod agenttask'[TaskStartTime].[Date], 'prod agenttask'[TaskEndTime].[Date], SECOND)

and once you have the number of seconds you can do simple math to figure out how many hours/minutes/seconds that is using the MOD() function. First figure out how many hours you have and then operate on the remainder to figure out your minutes, and then again on the remainder to figure out your seconds.

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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