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

View all the Fabric Data Days sessions on demand. View schedule

Reply
BigKev
Helper III
Helper III

Convert text data type to duration data type

Hi All,

 

I am trying to convert a text field to a duration, but my data comes in like this:
07:53.0
01:46.6
05:30.7
00:40.3
39:22.0

 

The format is mm:ss.0

 

I need to be able to sort from highest to lowest for time comparison. Hence I need to be able to convert it to duration data type.
The sort function is not working at the moment, as it is text.

 

I prefer to do the transformation in power query if possible.

 

Thanks all.

 

Cheers,

Kev

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @BigKev ,

this will be a little more complex than one might expect 😉

First you have to create 3 column that contain the minutes, the seconds, and the fraction of a second. You can use the Split by Delimiter operation
image.png

Then you can compute a fourth column that contains a decimal value representing seconds, you can use this value for sorting.

 

Hopefully, this provides some ideas on how to tackle your challenge.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey @BigKev ,

this will be a little more complex than one might expect 😉

First you have to create 3 column that contain the minutes, the seconds, and the fraction of a second. You can use the Split by Delimiter operation
image.png

Then you can compute a fourth column that contains a decimal value representing seconds, you can use this value for sorting.

 

Hopefully, this provides some ideas on how to tackle your challenge.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors