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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
fakeeh
New Member

Sorting Axis for Vizusalisations

Hi Need Help on this , i have a dataset like below that is  one customer query and customer rated like Average, Good, Poor, Excellent

image (3).png
so u sing these questions i created viz for each query like below
image (4).png
i didn't created measure , rather i used same column to take count 

now
i wanted to sort the x axis  in this order Excellent, Good, Average, Poor
for achiving this order, i tried to create another table with index column but that is not working becasue my data structure is different
plesae suggest ideas to achive this task,

regards
Data nerd

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @fakeeh 

As you mentioned, I've created a simple sample:

vjianpengmsft_0-1712892673328.png

The default sorting is as follows:

vjianpengmsft_1-1712892682344.png

Here's how to reorder the rating column by another column:

First, I created a calculated column using the following DAX expression, with the values representing the order in the x-axis.

Sort column = SWITCH('Table'[Rating],
    "Excellent",1,
    "Poor",3,
    "Good",2)

vjianpengmsft_2-1712892850127.png

To avoid circular dependency issues, I copied the Ratin column and named it Rating column:

vjianpengmsft_3-1712892954982.png

Then use the Sort column to sort the Rating column column, as shown in the following figure:

vjianpengmsft_4-1712893049368.png

Use the Rating column column as the x-axis in the column chart visual:

vjianpengmsft_5-1712893113315.png

At this point, the ordering of the x-axis has changed. When I change the numbers in the Sort column, the order of the x-axis changes dynamically:

vjianpengmsft_6-1712893209026.png

I provide the PBIX file used this time below.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

1 REPLY 1
Anonymous
Not applicable

Hi, @fakeeh 

As you mentioned, I've created a simple sample:

vjianpengmsft_0-1712892673328.png

The default sorting is as follows:

vjianpengmsft_1-1712892682344.png

Here's how to reorder the rating column by another column:

First, I created a calculated column using the following DAX expression, with the values representing the order in the x-axis.

Sort column = SWITCH('Table'[Rating],
    "Excellent",1,
    "Poor",3,
    "Good",2)

vjianpengmsft_2-1712892850127.png

To avoid circular dependency issues, I copied the Ratin column and named it Rating column:

vjianpengmsft_3-1712892954982.png

Then use the Sort column to sort the Rating column column, as shown in the following figure:

vjianpengmsft_4-1712893049368.png

Use the Rating column column as the x-axis in the column chart visual:

vjianpengmsft_5-1712893113315.png

At this point, the ordering of the x-axis has changed. When I change the numbers in the Sort column, the order of the x-axis changes dynamically:

vjianpengmsft_6-1712893209026.png

I provide the PBIX file used this time below.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors