Forum Discussion
Duration conversion issues
- 6 years ago
You can use the following custom step:
= Table.TransformColumns(PreviousStep,{{"ColumnName", each let parsed = Text.Split(_, ":") in #duration(0, 0, Int64.From(parsed{0}), Int8.From(parsed{1})), type duration}})Just change PreviousStep and "ColumnName" to appropiate values.
It worked, thanks a lot! Do you happen to know how can I display the data? At the visualization level I get very low number values.
Thank you!!
artemus wrote:You can use the following custom step:
= Table.TransformColumns(PreviousStep,{{"ColumnName", each let parsed = Text.Split(_, ":") in #duration(0, 0, Int64.From(parsed{0}), Int8.From(parsed{1})), type duration}})Just change PreviousStep and "ColumnName" to appropiate values.
As part of your final step you can change the column type back to text. Note that if you do this, it will display it in [dd.][hh:][mm:]ss format (as seen in the previewer.
However, if you do this it will not sort correctly in the visualizer. To get around this, duplicate the duration column and then change the one you want to display to text. After loading it into the report view, select the text field, then select Modeling from the top ribbon and Sort by Column and choose the duration column that wasn't changed to text.