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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tomshaw83
Helper I
Helper I

mm:ss.00 - converting to a duration

Hi all,

 

I have a lot of data in the format mm:ss.00 - however at present when I import it to powerbi it doesn't like the look of it as a duration. To convert it I am splitting the data into 3 columns minute / second / milisecond. Creating an additional hour column with a 0 for each row, then merging all four columns back together to get hh:mm:ss.00 - this then can be converted to a duration.

 

As I have a lot of data in this format, i was wondering if anyone else had encountered this problem, and if there was a simpler more elegant solution.

 

Thanks


Tom

1 ACCEPTED SOLUTION
Anonymous
Not applicable

See if this route is preferable

 

 

let
    Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjS1MjbXMzY1MjZSitWJVjIxtTI00jM0MjYGc40NrEzN9MwtLC2VYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Colonna1 = _t]),
    #"Prefisso aggiunto" = Table.TransformColumns(Origine, {{"Colonna1", each "00:" & _, type text}}),
    #"Aggiunta colonna personalizzata" = Table.AddColumn(#"Prefisso aggiunto", "Personalizzato", each Duration.From([Colonna1]))
in
    #"Aggiunta colonna personalizzata"

 

 

 

View solution in original post

2 REPLIES 2
tomshaw83
Helper I
Helper I

Excellent, one step solution, thank you

Anonymous
Not applicable

See if this route is preferable

 

 

let
    Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjS1MjbXMzY1MjZSitWJVjIxtTI00jM0MjYGc40NrEzN9MwtLC2VYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Colonna1 = _t]),
    #"Prefisso aggiunto" = Table.TransformColumns(Origine, {{"Colonna1", each "00:" & _, type text}}),
    #"Aggiunta colonna personalizzata" = Table.AddColumn(#"Prefisso aggiunto", "Personalizzato", each Duration.From([Colonna1]))
in
    #"Aggiunta colonna personalizzata"

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors