Forum Discussion

AnetaK's avatar
AnetaK
Icon for Helper V rankHelper V
3 years ago

How to sort 100 % Stacked bar chart?

Hello,

 

Is there a way to sort this chart from biggest to smallest values and not in the alphabetical order?

 

4 Replies

  • Hi AnetaK ,

    According to your description, here's my solution.

    Create a calculated column.

    Rank =
    RANKX ( 'Table', 'Table'[Value],, DESC, DENSE )
    

    Then select the Category column, in Column tools>Sort by column>Rank

    Get the expected result:

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • AnetaK's avatar
      AnetaK
      Icon for Helper V rankHelper V

      What if I want to slice my table by additional dimensions?

      Calculated column would not work then as this rank should be dynamic.

      Would a RANKX measure do?

      • v-yanjiang-msft's avatar
        v-yanjiang-msft
        Icon for Community Support rankCommunity Support

        Hi AnetaK ,

        I can't reproduce how a dimension dynamically change the value, could you please give an example?

        If we use the Category as a slicer, it still works.

        Best Regards,
        Community Support Team _ kalyj