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
Anonymous
Not applicable

Help keeping the salary ranges in descending order on my Y axis on a clustered bar chart

Hi everyone. 

 

I need the Y axis of salary ranges to 1) appear in the following order in Power BI desktop and 2) mainain this order when I use a Clustered Bar Chart. Unfortunately the sort by ascending and descending feature in Power BI is disrupts this. 

 

Below is the table of the desired order of salary ranges. Does anyone know how I might 'fool' Power BI desktop into not changing ascending and descending into this order?

 

My current salary is…
Over £200,000
£180,000 - 199,999
£160,000 - 179,999
£140,000 - 159,999
£120,000 - 139,999
£100,000 - 119,999
£80,000 - 99,999
£60,000 - 79,999
£40,000 - 59,999
£20,000 - 39,999
Under £20,000
Prefer not to answer
1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous 

 

It works fine in my side:

vjianbolimsft_0-1661135588627.png

 

Here is another way to help achieve your goal, please try:

Add Salary Sort as tooltips

vjianbolimsft_1-1661136117428.png

Then choose sort by Salary Sort:

vjianbolimsft_4-1661136317985.png

Final output:

vjianbolimsft_5-1661136346580.png

If this still doesn't work, please share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo 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

8 REPLIES 8
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

v-jianboli-msft
Community Support
Community Support

Hi @Anonymous 

 

It works fine in my side:

vjianbolimsft_0-1661135588627.png

 

Here is another way to help achieve your goal, please try:

Add Salary Sort as tooltips

vjianbolimsft_1-1661136117428.png

Then choose sort by Salary Sort:

vjianbolimsft_4-1661136317985.png

Final output:

vjianbolimsft_5-1661136346580.png

If this still doesn't work, please share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to my knowledge, this issue may caused by the data type of your "Salary Sort" column. If you want to sort it by order, the sort column need to be number type. Please check if it is Whole Number, it seems that it is text type in the picture:

vjianbolimsft_0-1660801405369.png

Best Regards,

Jianbo Li

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

Anonymous
Not applicable

Thanks @v-jianboli-msft 

 

I've changed to whole number, sorted by ascending, saved, and the Y axis in my visual is still not changing. 

I'm starting to think it is impossible to re order the Y axis in a Power BI visualisation unless the values in the Y axis itself have a numerical or string prefixed. e.g. A, B, C.....1,2,3............

Wonder if there is a way I can stick "1" in front of the values in the Y and make them disappear / not appear in the visual?

 

Desperate stuff............

Bubble4502
Resolver III
Resolver III

Hi @Anonymous ,

 

Approve @amitchandak ,

After you use Sort by column, you need to choose how to sort in the visual:

Bubble4502_1-1660204730460.png

 

Output:

Bubble4502_2-1660204743510.png

Kind Regards,

Bubble

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

Anonymous
Not applicable

Hi @Bubble4502 @amitchandak I've tried that, and it still has not worked. Providing table view and visual. The Y column still won't change.........

 

arundaka02_0-1660215641410.png

arundaka02_1-1660215657769.png

Note - I created my "Salary Sort" column using ELSEIF in Alteryx Designer, not Power BI, but I *assume this won't matter*?

 

Thanks,

KA

 

amitchandak
Super User
Super User

@Anonymous , You need to create a sort column.

Create in power query using if then else

salary range sort =

if [salary range]  ="Over £200,000" then 1

else if <> //adn so on

 

sort salary range on salary range sort (using sort column )

or

create columns in dax

salary range 1= [salary range]

 

salary range sort  = Switch([salary range],

"Over £200,000" ,1 ,

//add other

)

 

Then sort salary1 range on salary range sort (using sort column )

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

 

Sort Month.png

Anonymous
Not applicable

Hi @amitchandak thank you for this.

I've successfully created the new column and sorted in Query Editor.

However my visual still looks like the following. How do I ensure the Y column can be reflective of the column sort, and not the salary range?

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