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
Community Champion
Community Champion

 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!
"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

18 REPLIES 18
Matt82
Helper I
Helper I

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

Matt82_0-1640100396689.png

 

Hi @Matt82 

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

 

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

 

Hey @Matt82 

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. 

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

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 🙂

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?

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
Community Champion
Community Champion

 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!
"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!
"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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors