Forum Discussion

MarLinCH's avatar
MarLinCH
Regular Visitor
2 years ago
Solved

Formatting Text to Duration

Hi everyone, 

 

First time here, so I'm excited to get help - thank you very much. 

I receive a weekly update with data, including the time for certain calls. "Non ACD Calls in Time" and "Logged On Time (Per Skill Group)" are being seen as "Text," while "Non ACD Calls Out Time" is being seen as "Time." I would like to format all columns as "Time" to see how many hours, minutes, and seconds people spend on the phone. 

 

In the raw data set, everything is formatted as the same: 

Thank you very much for your help!

Cheers

Markus

  • Thank you very much - I've also found sth. that worked: 

    let
        DurationFromYourText = (text as text) as duration => let
            Split = Text.Split(text, ":"),
            AsNumbers = List.Transform(Split, Number.FromText),
            Duration = #duration(0, AsNumbers{0}, AsNumbers{1}, AsNumbers{2})
        in
            Duration,
        Invoked = DurationFromYourText([#"Logged On Time (Per Skill Group)"])
    in
        Invoked

5 Replies