Forum Discussion
Sort chart x axis
Hi everyone,
This seems an extremely basic problem, but I can't sort a graph by its x-axis alphabetically. Here is a reproducible example:
Take this dummy data:
| Letter | Number |
| A | 1 |
| B | 2 |
| C | 3 |
I use this to create a simple bar chart in Power BI desktop. I cannot sort the x-axis ascending by letter - I can have it descending, or I can sort either way by number (i.e. I can sort on the values rather than the axis variable).
Anyone know why I'm getting this behaviour?
Hi tomwwagstaffRIT,
Based on your screenshot, Sort by Category has already been activated. Just click again on Z-A icon. It should change to A-Z once the sort order has been changed to ascending.
20 Replies
- AnonymousNot applicable
The key point is that you have to click on the elipsis in the upper right. Took me a while.
- OmitskyFrequent Visitor
BRO YOU ARE A LIFE SAVER !!! YOU HELPED ME GET THIS ISSUE DONE BIG TIME
- AnonymousNot applicable
Hi
One way to solve the problem is to add a another column to the data table with ranking numbers (the way you want to sort it).
Then in the graph, add that column to the Tooltips field on the right bar. Then click on the three dots --> sort by --> choose the column --> check that it's A to Z.
Hope that helps 🙂
- AnonymousNot applicable
Hi ,
But the problem with Tooltips is it does the sort for us. But when you are pointing in the bar the tooltips appers when you hover over the values in your chart. It shouldn't happens right? how do i disable that tooltip in not showing to the end user, he don't want to know that we sorted by some xyz, when he hovers over the bar in our chart.
- danextianSuper User
Hi tomwwagstaffRIT,
Based on your screenshot, Sort by Category has already been activated. Just click again on Z-A icon. It should change to A-Z once the sort order has been changed to ascending.
- tomwwagstaffRITFrequent Visitor
Hi danextian,
Well that worked! I swear I had clicked that icon repeatedly before with no effect - but it switches sort order now. Thanks for your time and attention on such a silly problem!
Cheers,
Tom
- danextianSuper User
The same thing happened to me. Later did I realize that I didn't click the sort I con at all, just the category to sort the chart by.
- oslo3452New Member
I am facing a similar problem but with months. I want to sort months from Jan - Dec but looks like it can only sort alphabettically (ascending or descending)
- AnonymousNot applicable
Hi Oslo. Not sure if you've got the answer to this. But did you try changing the format of the Months in the Data tab?
By the looks of it, the months have been categorized as "text" in Data Type. Changing it to appropiate Date format should help.
- AnonymousNot applicable
Hello, could you solve it?
- AnonymousNot applicable
Hi people anyone know how i can have the x axis appearing as in the screenshot please?
- AnonymousNot applicable
Hi Anonymous
> Select a column or line visual. On the X axis drag drop a date field (Data type should be "Date"). On the axis option, select "Date Hierarchy" and get rid of Quarter and Day. Also click on the drill down to "At lowest level of Data". Your visual should look something like below:
> go to "Format your visual" > X axis > and turn OFF "Concatenate Labels":
This should do the trick.
- AnonymousNot applicable
Hi,
Thank you so much for you help. I am almost there. The below is how mine is appearing