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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Thennarasu_R
Responsive Resident
Responsive Resident

How to convert Time To Seconds

Hi All,
I stuck with one scenarios,
Anyone help this one

I have two columns
One is Start Time=1:22:00
Second is End Time=19:23:00
My need is In Between time Overall Seconds and Hours 

Thanks,
Thennarasu R

1 ACCEPTED SOLUTION
v-xiaosun-msft
Community Support
Community Support

Hi @Thennarasu_R ,

 

According to your description, here is my solution.

You can use Duration.FromDuration.TotalHours and Duration.TotalSeconds in Power Query.

Create custom columns.

1, return the duration between two times.

 

= Duration.From([End time]-[Start time])

 

vxiaosunmsft_0-1668495422156.png

2, return Overall Seconds

 

= Duration.TotalSeconds([duration])

 

vxiaosunmsft_1-1668495502463.png

3, return Overall Hours

 

= Duration.TotalHours([duration])

 

vxiaosunmsft_2-1668495550226.png

Final output:

vxiaosunmsft_3-1668495645654.png

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xiaosun-msft
Community Support
Community Support

Hi @Thennarasu_R ,

 

According to your description, here is my solution.

You can use Duration.FromDuration.TotalHours and Duration.TotalSeconds in Power Query.

Create custom columns.

1, return the duration between two times.

 

= Duration.From([End time]-[Start time])

 

vxiaosunmsft_0-1668495422156.png

2, return Overall Seconds

 

= Duration.TotalSeconds([duration])

 

vxiaosunmsft_1-1668495502463.png

3, return Overall Hours

 

= Duration.TotalHours([duration])

 

vxiaosunmsft_2-1668495550226.png

Final output:

vxiaosunmsft_3-1668495645654.png

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ppm1
Solution Sage
Solution Sage

Please see this article on how to best calculate durations.

Calculate and Format Durations in DAX – Hoosier BI

 

Pat

 

Microsoft Employee
Thennarasu_R
Responsive Resident
Responsive Resident

@ppm1 
I found it Using Measures 

Measure =
TIME ( 0, 0, 0 )
    + DIVIDE ( SUM ( tbl[Sum of Seconds] ) , ( 24 * 60 * 60 ) )
Once Create Measure Change the data type HH:MM:SS.

Thanks,
Thennarasu 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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