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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.

Thanks

Ian

1 ACCEPTED SOLUTION
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

4 REPLIES 4
Community Support

Hi @Pick ,

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

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
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

#### Join our Community Sticker Challenge

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors