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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
hazeltine
Regular Visitor

Custom sort legend issue

I am trying to reorder the legend and the order of stacked bars for this chart.

hazeltine_2-1722372572831.png

 

I added a new column with numbers to create custom sort order, then did sort by column "Custom Sort (Job related stress)". This method has worked for me before but with this data I keep getting this error message: 

hazeltine_0-1722372333763.png

Is it something with the data? As far as I know there are no repeated values for the custom sort column vs job related stress column. I have "Less than once a week", "Once a week", "A few times a week", and "Almost every day". Is it picking up "Less than once a week" and "once a week" as the duplicated values? I have tried doing custom sort and removing "Once a week" but still got the same error message.

hazeltine_1-1722372454664.png

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

The job related stress column should be OK - it's what's in your "Custom Sort (Job related stress)" column that would be causing issues.

Here's how i would debug - create a simple table and put Job related stress (don't summarize) and distinct count of Custom Sort (Job related stress) in the table and sort by the count - this should help you find which specific values for Job related stress are causing issues. You can then fix the sort column to make all the values unique. Note - blank values will count towards "duplicate values" for the purposes of sorting.

 

 

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

The job related stress column should be OK - it's what's in your "Custom Sort (Job related stress)" column that would be causing issues.

Here's how i would debug - create a simple table and put Job related stress (don't summarize) and distinct count of Custom Sort (Job related stress) in the table and sort by the count - this should help you find which specific values for Job related stress are causing issues. You can then fix the sort column to make all the values unique. Note - blank values will count towards "duplicate values" for the purposes of sorting.

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.