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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
FloBar
New Member

Not possible to convert a cell in a duration

Hello, 

 

I am currently blocked with this Data type conversion I should have the reading 39:38:58. I am always missing 24 hours

 

Right after the import, I have this. 

FloBar_0-1712004076566.png

I try to change it to time but I the first 24 hours aren't there

FloBar_1-1712004110321.png

Could you please help me

 

Thanks 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @FloBar

 

@Zang_Mi Thank you very much for your prompt reply.

 

For your question, I would recommend creating a column to make changes to the date.

 

Here's some dummy data

 

“Table”

vnuocmsft_0-1712641013471.png

 

create a column.

 

 

Duration = 
VAR _time = HOUR([Temps en operation (h:mm:ss)]) + 24 & ":" & MINUTE([Temps en operation (h:mm:ss)]) & ":" & SECOND([Temps en operation (h:mm:ss)])
RETURN _time

 

 

Here is the result.

 

vnuocmsft_1-1712641048745.png

 

If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @FloBar

 

@Zang_Mi Thank you very much for your prompt reply.

 

For your question, I would recommend creating a column to make changes to the date.

 

Here's some dummy data

 

“Table”

vnuocmsft_0-1712641013471.png

 

create a column.

 

 

Duration = 
VAR _time = HOUR([Temps en operation (h:mm:ss)]) + 24 & ":" & MINUTE([Temps en operation (h:mm:ss)]) & ":" & SECOND([Temps en operation (h:mm:ss)])
RETURN _time

 

 

Here is the result.

 

vnuocmsft_1-1712641048745.png

 

If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FloBar
New Member

hello,

I still have the issue, this is not working

Thanks for your help

Zang_Mi
Resolver II
Resolver II

Hello, if the duration can be over 24 hours, then you need to transform the text to the format d.hh:mm:ss before converting it to duration data type.

For example: from 39:38:58 to 1.15:38:58

Zang_Mi_1-1712007685181.png


M Query with the example and steps to apply:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMra0MrawMrVQitWJVjI0tTIwsjIxVYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Duration = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Duration Format", each let
hours_to_days = Number.FromText(Text.BeforeDelimiter([Duration], ":"))/24,

days = Number.RoundDown(hours_to_days),

hours = (hours_to_days-days)*24,

minutes_and_seconds = Text.AfterDelimiter([Duration], ":"),

duration_text = 
Number.ToText(days) & "." & 
Number.ToText(hours) & ":" &
minutes_and_seconds

in duration_text),
    #"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Duration Format", type duration}})
in
    #"Changed Type"

 

 If this answer helps you, please give a kudo and mark it as solution ‌‌🙂.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.