Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CoreyPawlak
Regular Visitor

Re-ordering the x-axis values

Hi, I  am creating Power BI reports and would like to re-order the presentation of the x-axis values in a couple of charts.

1) In a chart showing time-to-consume on the x-axis, I have the x-axis values as <5 min, 5-14 min, 15-60 min, >60 min.  I'd obviously like them ordered chronologically, but they're showing up in the following oder: <5 min, >60 min, 15-60 min, 5-14 min -- not exactly intuitive for the viewer!  How can re-arrange the order in which they're presented?

 

2) Similarly, I've a chart with x-axis values: Read, Watch, Try, and Prove.  Instead of being ordered by this logic, they're being ordered alphabetically as Prove, Read, Try, Watch.  How can I order the values in my desired order?

 

I'm relatively new to Power BI (and love it!), so please be detailed in (hopefully) presenting a solution.

Thank you!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

You need to use "Sort By Column" in the Modeling tab in the Data Model. So, go to your Data Model, choose your column go to Modeling tab and choose "Sort By Column". In your case, it may make sense to create an Enter Data query and put in your x-axis values along with a "Sort By" column, so something like:

 

Category,Sort By

<5 min,1

5-15 min,2

15-60 min,3

>60 min,4

 

Sort your Category column by "Sort By", relate this table to your fact table. Use this Category field in your visual. That's the gist of it.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

You need to use "Sort By Column" in the Modeling tab in the Data Model. So, go to your Data Model, choose your column go to Modeling tab and choose "Sort By Column". In your case, it may make sense to create an Enter Data query and put in your x-axis values along with a "Sort By" column, so something like:

 

Category,Sort By

<5 min,1

5-15 min,2

15-60 min,3

>60 min,4

 

Sort your Category column by "Sort By", relate this table to your fact table. Use this Category field in your visual. That's the gist of it.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I found this post to order values in the x-labels, which I also am looking for solutions.
In my case, however, I'd like the order to follow from another column -call it value- based on its average, and using the x-axis column as a grouping variable. 

I did see find value under Modeling > Sort by Column, but it didn't work to order because there are different values for each x-axis label.  

How do I go about to calculate the average and sort the x-axis column? 

Thank you. 

 

 

Good solution, what happens when the "Sort by column" feature is not clickable?

 

SortByDisabled.png

Thanks !!!

It worked!!! Thank you so very much!

Cool, happy to help!


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors