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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to convert HH:MM:SS to seconds using DAX ?

I want to convert HH:MM:SS format of time into seconds.

 

Whenever I change it using format and use SECONDS it only gets the seconds of that time not the whole duration in seconds.

 

Thanks for answering! Really appreaciate it!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous  Does this work for you

 

Column = MINUTE(Table[date time])*60+SECOND(Table[date time])

 

 In case you also have hours in your datetime field please extract the hour and multiple by 3600

 

You can also try DATEDIFF function and use second as third argument

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@Anonymous Have you tried second function

Column = SECOND(table[date time])
Anonymous
Not applicable

Hi Vimal, thanks for answering, however its still showing only seconds of the time that i wanted to convert.

 

Ex.

00:28:53 - im only getting the 53 seconds whenever i use the dax formala that you've given.

Anonymous
Not applicable

@Anonymous What exactly you need 
Suppose if the value is 00:28:53 --> output --?
You can few more example with expected outcome

Anonymous
Not applicable

instead of 53 seconds only, I wanted also to convert the 28min into seconds as well. So in total, I wanted a result of 1733sec.

 

Is there any easiest way to convert this one aside from manually compute it ?

Anonymous
Not applicable

@Anonymous  Does this work for you

 

Column = MINUTE(Table[date time])*60+SECOND(Table[date time])

 

 In case you also have hours in your datetime field please extract the hour and multiple by 3600

 

You can also try DATEDIFF function and use second as third argument

Anonymous
Not applicable

Wow! That was fast ! Thanks Vimal, you're great. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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