Forum Discussion

E_K_'s avatar
E_K_
Icon for Helper III rankHelper III
1 year ago
Solved

hh:mm data values not sorting high to low correctly - conversion

I have measures that calculate durations. Durations in minutes, and then converting that to hh:mm.

The measures are [Client Sev 1 Impact] and [Client Sev 2 Impact], both of which produce a whole number value 

My conversion measure is as below

 

Client Impact 1+2 duration (hh:mm) =

VAR Hours = [Client Sev 1 Impact] + [Client Sev 2 Impact]/ 60
VAR Minutes = MOD([Client Sev 1 Impact]+[Client Sev 2 Impact], 60)
RETURN
   FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00")

 

When I put in a matrix visual (or whatever), these do not sort correctly./ Help? Probably the conversion measure I know, how can I tweak it so it sorts correctly

 

 

  • Hi E_K_ ,

     

    The issue here is that you're formatting the duration as a text string (hh:mm), and text values sort alphabetically — not numerically. That’s why the sorting looks off.

    To fix this, you can do two things:

    1. Keep your current measure for display, so users still see the hh:mm format.
    2. Create a separate numeric measure (like total minutes) and use that for sorting.

    Example:

    Client Impact Total Minutes = 
    [Client Sev 1 Impact] + [Client Sev 2 Impact]

    Then in your matrix visual, sort the hh:mm column by this new numeric measure. That way, the visual looks right and sorts correctly.

    Let me know if you need help setting up the sort in the visual.

    If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
    translation and formatting supported by AI

4 Replies

  • Hi E_K_ ,

     

    The issue here is that you're formatting the duration as a text string (hh:mm), and text values sort alphabetically — not numerically. That’s why the sorting looks off.

    To fix this, you can do two things:

    1. Keep your current measure for display, so users still see the hh:mm format.
    2. Create a separate numeric measure (like total minutes) and use that for sorting.

    Example:

    Client Impact Total Minutes = 
    [Client Sev 1 Impact] + [Client Sev 2 Impact]

    Then in your matrix visual, sort the hh:mm column by this new numeric measure. That way, the visual looks right and sorts correctly.

    Let me know if you need help setting up the sort in the visual.

    If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
    translation and formatting supported by AI

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi E_K_,

    Thank you for reaching out to the Microsoft Fabric Forum Community.
    And also Thanks to burakkaragoz for Prompt and useful response.

     

    Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.

    If the response addressed your query, kindly mark it as Accepted Solution and click Yes if you found it helpful  this will benefit others in the community as well.

     

    Best regards,

    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi E_K_,

     

    We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.

    If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution  it helps others who might face a similar issue.

     

    Warm regards,

    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi E_K_,

     

    We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.

    If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution  it helps others who might face a similar issue.

     

    Warm regards,

    Prasanna Kumar