Forum Discussion

crwinchester's avatar
crwinchester
Advocate I
3 years ago

Super Stupid: How do you sort Visual Legend by Value?

I see there a number of questions about this, but the answers are disturbingly complex - Where is the button that I click to have a legend sort by value? I've already sorted all the underlying data in the correct order, but the visuaI is not sorting this correctly. What am I missing? 

 

Sorting is incorrect.

8 Replies

  • kpost's avatar
    kpost
    Solution Sage

    ->three dots in the top right

    -> Sort axis
    -> Group

    -> Sort Ascending

    • crwinchester's avatar
      crwinchester
      Advocate I

      Right. So, what if the "Sort axis" option doesn't exist from the menu that appears when you click the ellipsis of the visual object?

  • kpost's avatar
    kpost
    Solution Sage

    Alternative solution I just got working, based loosely on this approach:
    https://www.seerinteractive.com/insights/reorder-powerbi-legend

    I created a new table using :

    sort_table = generateseries(1,1000,1)

    I then made a relationship between that column and the [group] column.


    then I added this column to the same table where the [group] column is located:

    custom sort = RELATED(Sort_table[Value])


    Then I selected the [group] column and used the "Sort by Column" option under "Column Tools" and selected [custom sort].

    • crwinchester's avatar
      crwinchester
      Advocate I

      Thanks for this response. I followed these instructions and there was no effect. I created a new table by entering data. I then established the cardinality, created a column with the related function, and finally told the visual to sort the data by that column. PowerBI still disobeys the sorting logic. I think there may be a glitch. Sorting the data with inherint sorting qualities should sort automatically OOTB. Unless there is another method I'm missing? 

      • kpost's avatar
        kpost
        Solution Sage

        What is the name of the visual you are using?  It doesn't appear to be behaving the way the ones that come standard with the desktop software do...  I'll download it and see if I can get it to work.