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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

I can't turn data type to duration

Hello everyone,

 

I'm currently trying to turn a string column to duration type using Power Query :

 

PBI1.png

 

But it results as an error :

 

PBI2.png

 

Why do you think that happens? Do you think it doesn't work because of the data format or something else ?

3 REPLIES 3
KBO
Memorable Member
Memorable Member

HI @Anonymous ,

here is a the same question, maybe it solves the Problem 🙂 https://community.powerbi.com/t5/Power-Query/Duration-conversion-issues/td-p/819935

 

 

 

 

 

If this post has helped you, please give it a thumbs up!
Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Hello,

Thanks for the tip, it kinda worked, but not perfectly : PBI3.png

 

The format is all right, but it's now counting what are supposed to be hours as minutes.
I guess it's because of something in the DAX code. I'm not very found of this code, so does an easy fix exists ? Or maybe resources to learn more about the DAX.

Thank you by advance.

KBO
Memorable Member
Memorable Member

Hi @Anonymous ,

this is not DAX its M-Script in Power Query :). If you are looking to learn more about Power Query, there are a lot of great Blogs and Youtube Videos out there :).

If you have a Demo file for me I can check your code and formatting 🙂

Best,

Kathrin

 

 

 

 

If this post has helped you, please give it a thumbs up!
Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.