Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a colum that has duration as a text string "15 Hours, 48 Minutes". Is it possible to covert this to a decimal hour?
Hi @bwelsh,
Could you please mark the proper answer as solution or share the answer if it's convenient for you? That will be a help to the others.
Best Regards!
Dale
My interpretation is that you want 15.8 as a result.
In Power Query it can be done by taking the part before the first space, convert this to a number and take the part between the second and the third space, convert this to a number, divide by 60 and add to the first number.
Example code from Power Query - Advanced Editor:
let
Source = #table(1,{{"15 Hours, 48 Minutes"}}),
TextToHours = Table.TransformColumns(Source, {{"Column1", each Number.From(Text.BeforeDelimiter(_," "))+Number.From(Text.BetweenDelimiters(_, " ", " ", 1, 0))/60, type number}})
in
TextToHours
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 35 | |
| 34 | |
| 27 |
| User | Count |
|---|---|
| 136 | |
| 99 | |
| 73 | |
| 66 | |
| 65 |