cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tomwwagstaffRIT
Frequent Visitor

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:

LetterNumber
A1
B2
C3

 

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).

 

power_bi_cant_sort.PNG

Anyone know why I'm getting this behaviour?

1 ACCEPTED SOLUTION
danextian
Super User
Super 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.






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

View solution in original post

19 REPLIES 19
Anonymous
Not applicable

Hi people anyone know how i can have the x axis appearing as in the screenshot please?

Matt82_0-1640100396689.png

 

Anonymous
Not 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: 

adnanzakir_1-1640127541241.png

 

> go to "Format your visual" > X axis > and turn OFF "Concatenate Labels": 

adnanzakir_2-1640127785475.png

 

This should do the trick. 

 

Anonymous
Not applicable

Hi 

 

Thank you for your help. The below is how mine is appearing. Any idea how i can get this similar to yours? I have followed the instructions you have sent but it was difficult for me to see the images clearly due to the resolution. 

 

Matt82_1-1640168421406.png

 

Anonymous
Not applicable

Hey @Anonymous 

You're almost there, the only step left is go to "Format the visual" > Go to X Axis > Go to Concatenate labels and turn it off 

adnanzakir_0-1640212845100.png

That should do the trick. 

Please accept the answer as solution if this works. Cheers. 

Anonymous
Not applicable

awesome, thanks-I was missing the conctaenate labels part 🙂

Anonymous
Not applicable

Hi,

 

Thank you so much for you help. I am almost there. The below is how mine is appearing 

 

Matt82_0-1640168315935.png

 

Anonymous
Not 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 🙂

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.

BillRothVMware
Frequent Visitor

The key point is that you have to click on the elipsis in the upper right. Took me a while.

BRO YOU ARE A LIFE SAVER !!! YOU HELPED ME GET THIS ISSUE DONE BIG TIME

oslo3452
New 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)

monthly report.PNG

Hello, could you solve it?

Anonymous
Not 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. 

danextian
Super User
Super 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.






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

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

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.






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

Glad to know it's not just me...

Thank you!!!!!!!!! Caught me out as well...

Thanks!!!!! This caught me out as well...

Helpful resources

Announcements
Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.