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
Demographer
New Member

Cuztom order of X axis

Hi,

I'm trying to have cuztom order of the X axis of a column chart. I can't manage in the chart to have the correct order of column (it should be 2016 / 2061 - Ref / 2061 - Intermédiaire / 2016 - Final). I found some solutions on the forum saying I should create a new variable with values 1-2-3-4 corresponding to the order I want. However, when I do that, those values (1-2-3-4) appear on the label of the X axis (see screenshot). I also saw some other solutions, but it looks like they are not available with PBI Desktop.

 

Capture.JPG

My data are: 

 

ScenarioAFOOrder
20160.1072180.8004680.0923141
2061 - Ref0.1454490.7140090.1405422
2061 - Intermédiaire0.1452780.7363390.1183833
2061 - Final0.1445040.7538340.1016624

 

1 ACCEPTED SOLUTION

I've tried to recreate your scenario below:Gif_3.gif

/ J


Connect on LinkedIn

View solution in original post

9 REPLIES 9
amitchandak
Super User
Super User

@Demographer , have you marked Order as the sort column for Scenario and sorted the visual on Scenario using three dots

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

tex628
Community Champion
Community Champion

Hi @Demographer ,

You don't actually need to use your custom sorting column inside the visual. instead use the sort by column functionality to sort the campaign column by the custom sorting column:

image.png

Select the campaign column, navigate to the "Sort by column" and then select your sorting column. This requires a 1 to 1 relationship between the values, meaning that there can not be two campaigns with the same sorting value and vice versa. 

Br,
J


Connect on LinkedIn

Thank you for you answer @tex628 . Maybe there is something I did wrong, but it still doesn't work.

 

I sorted column by scenarios.

 

Capture.JPG

 

However, the order in the chart is still wrong (2061 - Ref and 2016 - Final should swap). I try to reassign order with the ..., but still no result.

 

Capture2.JPG

Sort by "Order" instead of scenario!


Connect on LinkedIn

Same...

It works only if I include "Order" in the X axis. But then, the labels include the value 1/2/3/4.

I've tried to recreate your scenario below:Gif_3.gif

/ J


Connect on LinkedIn

Yes, the column 2061-Final should be the last on the right. The column 2061-Ref should be the second from the left (as in the original data).

It's still not working even after applying the same steps that im doing in the gif above?

/ J


Connect on LinkedIn

Sorry I didn't realize it was an animated gif. Yes, now it works! Thanks for the tutorial.

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.