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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
christ7
Frequent Visitor

X Axis Custom sort

Hello,

The chart below displays columns by date (chronologically then alphabetically), yet I need to change this and have tried numerous ways but unable to do so. Is there any way I can cusom sort or create something?

I need it to show:

2018-2019 Pre-season -> 2018-2019 Mid-season -> 2018-2019 End-season

 

Power BI.png

Any help is appreciated

Thank you

2 ACCEPTED SOLUTIONS
DeanWHall
Resolver I
Resolver I

Hi,

 

The trick to this is to not try to solve your problem in the chart !

 

The x-Axis must be type categorical (text type field for example) - which your data seems to be.

 

To have a cusomt order, resort to your data itself.  You will need a reference table that has your x-axis values and a second column (numeric) that is your desired sort order.

 

The sorting table would look something like this:

 

Category                                     Position

2018-2019 Pre-season     1

2018-2019 Mid-season    2

2018-2019 End-season    3

 

Create a reference linking this table to your main data.

 

Now navigate to your data table where the Category field is, and highlight the column.  In the Modeling Tab, there is an option to 'Sort By Column' and select the 'Position' column from the table above.

 

Now, in your chart, the default sorting for the Categorical X-Axis uses the rules applied to the field itself - which are now your custom sort for 'Position'.

 

Regards,

 

Dean

View solution in original post

v-xuding-msft
Community Support
Community Support

Hi @christ7 ,

As DeanWHall said, you need to create a new table to implement it. 

Create a new table > manage relationship between tables > sorting new tables order by new column in new table

 

There is a similar thread that you can reference.

https://community.powerbi.com/t5/Desktop/Custom-Sorting-in-PowerBI/m-p/128051#M54392

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @christ7 ,

As DeanWHall said, you need to create a new table to implement it. 

Create a new table > manage relationship between tables > sorting new tables order by new column in new table

 

There is a similar thread that you can reference.

https://community.powerbi.com/t5/Desktop/Custom-Sorting-in-PowerBI/m-p/128051#M54392

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DeanWHall
Resolver I
Resolver I

Hi,

 

The trick to this is to not try to solve your problem in the chart !

 

The x-Axis must be type categorical (text type field for example) - which your data seems to be.

 

To have a cusomt order, resort to your data itself.  You will need a reference table that has your x-axis values and a second column (numeric) that is your desired sort order.

 

The sorting table would look something like this:

 

Category                                     Position

2018-2019 Pre-season     1

2018-2019 Mid-season    2

2018-2019 End-season    3

 

Create a reference linking this table to your main data.

 

Now navigate to your data table where the Category field is, and highlight the column.  In the Modeling Tab, there is an option to 'Sort By Column' and select the 'Position' column from the table above.

 

Now, in your chart, the default sorting for the Categorical X-Axis uses the rules applied to the field itself - which are now your custom sort for 'Position'.

 

Regards,

 

Dean

How do you disable the auto sort feature on the visual that is overriding my custom sort? 

22LACMT_0-1672856581507.png

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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