Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Custom sort on x-axis

Hi there,

 

I have spent several hours trying to get my column chart displaying the columns in the right order. I have this chart:

But I need it to sort the x-axis as follows:

Response

Every day
2-3 times a week
Once a week
2-3 times a month
Once a month
Less than once a month
Never

 

I have tried creating a new table with the above, and sorting it by an index, but it is still not working. Any ideas or help would be much appreciated. Thank you so much in advance!

  • Hi, Anonymous ;

    You could transform data then add index column.

    Then click Response column and sort by Index column.

    Set sort axis.

    The final output is shown below:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

6 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    You could transform data then add index column.

    Then click Response column and sort by Index column.

    Set sort axis.

    The final output is shown below:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • 22LACMT's avatar
      22LACMT
      Helper III

      Thank you for the above. however, my selections in my visuals seem to be different.  Is there something I need to do for it to apear? 

       

  • Create a new conditional column "Sort/Order" in powerquery based on x-axis column and use the new column as Sort for x-axis.

     

     

     

    Regards
    DI

    Did I answer your question? Mark my post as a solution, this will help others!
    Kudos are also welcome.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I dont want to sort my master table with a new column, because for another visual, I will need to sort on another column, if that makes sense?

      • PaulDBrown's avatar
        PaulDBrown
        Community Champion

        Create a dimension table for the values in the axis and add the sorting order column using SWITCH. Sort the values by the sort order column and then use this field as the axis

  • When I click on the elipsis (three dots ....)  I do not have the option to "Sort By"

    Can I add that option in somehow? 
    Thanks!