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
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
v-jianpeng-msft
Community Support
Community Support

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
v-jianpeng-msft
Community Support
Community Support

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