Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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 |
Solved! Go to Solution.
Hi @Anonymous
It works fine in my side:
Here is another way to help achieve your goal, please try:
Add Salary Sort as tooltips
Then choose sort by Salary Sort:
Final output:
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.
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.
Hi @Anonymous
It works fine in my side:
Here is another way to help achieve your goal, please try:
Add Salary Sort as tooltips
Then choose sort by Salary Sort:
Final output:
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.
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:
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.
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............
Hi @Anonymous ,
Approve @amitchandak ,
After you use Sort by column, you need to choose how to sort in the visual:
Output:
Kind Regards,
Bubble
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.........
Note - I created my "Salary Sort" column using ELSEIF in Alteryx Designer, not Power BI, but I *assume this won't matter*?
Thanks,
KA
@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
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?
User | Count |
---|---|
124 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
116 | |
102 | |
71 | |
61 |