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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Syndicate_Admin
Administrator
Administrator

Convert text Format 1h 30m to time field

Good morning.

I have a question regarding how to convert a text data that has a certain mask to a time field.

The data is provided by excel and in one of the fields I receive hours with the following format.

7h 30m

6h 50m

From this column I would like to extract another commune with time format.

Thank you

1 ACCEPTED SOLUTION

Thank you for the proposal, in the end I have chosen to separate the text into two parts, what is before the "h" and what is behind, with that I build a text with 00:00 format and from here I convert to time.

Best regards.

View solution in original post

2 REPLIES 2
HughLa
Resolver IV
Resolver IV

Hi @Syndicate_Admin 

 

You can go to the table in your Power Query Editor (Transform Data), and add a custom column.

I managed to transform it to this:

HughLa_1-1667910854111.png

Then you can change that data type to time.

Here is the formula:

 

let splitTime = Splitter.SplitTextByDelimiter("h", QuoteStyle.None)([Time]) in Text.Combine({Text.Middle([Time], 3, 1), Text.Combine(List.Transform(splitTime, each Text.Start(_, 2)), ":")})

 

 

I hope it works for you.

Thank you for the proposal, in the end I have chosen to separate the text into two parts, what is before the "h" and what is behind, with that I build a text with 00:00 format and from here I convert to time.

Best regards.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors