Forum Discussion

Thennarasu_R's avatar
Thennarasu_R
Responsive Resident
3 years ago
Solved

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

  • 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])

     

    2, return Overall Seconds

     

    = Duration.TotalSeconds([duration])

     

    3, return Overall Hours

     

    = Duration.TotalHours([duration])

     

    Final output:

     

    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.

3 Replies

    • Thennarasu_R's avatar
      Thennarasu_R
      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 
  • v-xiaosun-msft's avatar
    v-xiaosun-msft
    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])

     

    2, return Overall Seconds

     

    = Duration.TotalSeconds([duration])

     

    3, return Overall Hours

     

    = Duration.TotalHours([duration])

     

    Final output:

     

    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.