Forum Discussion

sffc's avatar
sffc
Helper I
5 years ago
Solved

Time Duration Returned in Number Format

This solution to convert seconds into a time duration works correctly, however, the returned text sorts only by the first number in the string and not by the durations' actual magnitude.  

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486


The screen capture below is an example, where 3,161:29:60 would be preferred to sort at the top of the list as being the longest duration and so on -

 

The only way I can get the desired result is by sorting the seconds, but having the seconds as a column in the table is not a desired result as shown in the screen capture below -

 

 

 

Is there a good way to have duration sorting from greatest to least aside from using the seconds for sorting?  I don't see there's a way to hide a column either..  Thanks in advance. 

 

 

  • Hi sffc ,

     

    Since this is transformed into text you cannot get the sorting you need witouth the additional column, one option can be to make your syntax starting with has many 0 has needed instead of blanks in this case you data would look like:

     

    3161:29:60

    2763:39:34

    1140:16:18

    0246:54:14

    0172:39:27

     

    and so on.

1 Reply

  • Hi sffc ,

     

    Since this is transformed into text you cannot get the sorting you need witouth the additional column, one option can be to make your syntax starting with has many 0 has needed instead of blanks in this case you data would look like:

     

    3161:29:60

    2763:39:34

    1140:16:18

    0246:54:14

    0172:39:27

     

    and so on.