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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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