Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I am trying to convert a column type string to duration and tried doing my own research to do it, but I have failed.
This is the column I am needing to convert.
This is the M code I am using.
= Table.TransformColumns(#"Changed Type",{"Resolution Time (in Hrs)",each
let txt=_,
h=Number.From( Text.Start(txt,2)),
mm=Number.From( Text.Middle(txt,3,2)),
ss=Number.From( Text.End(txt,2)),
dd=Number.IntegerDivide(h,24),
hh=Number.Mod(h,24)
in
#duration(dd,hh,mm,ss),
type duration
}
)
Here are the results
I believe I am getting the errors because of the 3 digit hours, but I do not understand or know how to do a range for the start.text or if that is even how I should approach this.
Please help!
You can use Text.BeforeDelimiter, .AfterDeli... , .BetweenDelim... for this.
--
A slightly easier way might be to Split the column on ":" and then add a custom column to construct the desired result , for example, #duration(0,1stCol, 2ndCol, 3rdCol)