Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi All,
I just wanted to ask for help on how to convert the Time to first response: Elapsed column, with type string, to duration by still containing the __h __m format?
The business users prefer to sort this column by still seeing the same format but can't since it is in string type. I tried doing things on my end but it is having errors as it does not display those with greater than 24h.
Would greatly appreciate your help.
Thanks.
Solved! Go to Solution.
=Duration.From(Expression.Evaluate(List.Accumulate({{"h","/24+0"},{"m","/1440"}},[#"Time to first response: Elapsed"],(x,y)=>Text.Replace(x,y{0},y{1}))))
=Duration.From(Expression.Evaluate(List.Accumulate({{"h","/24+0"},{"m","/1440"}},[#"Time to first response: Elapsed"],(x,y)=>Text.Replace(x,y{0},y{1}))))
You can add a custom column in the query editor with this expression (replace ElapsedTime with your actual column name). Once that creates a duration column, it will convert to a decimal # when you load it. Take a look at this article for how to then calculate your measures and format it at the end to show as hours and minutes.
Calculate and Format Durations in DAX – Hoosier BI
=#duration(0, Number.FromText(Text.BeforeDelimiter([ElapsedTime], "h")), Number.FromText(Text.BetweenDelimiters([ElapsedTime], " ", "m")), 0)
Pat
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
29 | |
12 | |
12 | |
11 | |
8 |
User | Count |
---|---|
54 | |
27 | |
15 | |
14 | |
13 |