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! Request now

Reply
Anonymous
Not applicable

Sorting

Hello!

 

I have a sorting problem i do not know how to solve. i get the error:

We can't sort the 'State' column by 'State Sort Order'. There can't be more than one value in 'State Sort Order' for the same value in 'State' Please choose a different column for sorting or update the data in 'State Sort Order'.

 

The problem im facing here is my data looks like:

IDStateState CategoryState Sort Order
1Removed  
2CommittedInProgress2
3In ProgressInProgress2
4In ProgressInProgress2
5ApprovedInProgress2
6ApprovedProposed1
7ApprovedProposed1
8DoneCompleted3
9doneCompleted3
10DoneCompleted3

 

i made bold what goes wrong. I give the state sort order a value based on the State Category. I tried doing this on 2 different ways, but ofcourse the same outcome.

1st attempt is a column with:

 

State Sort Order = 
SWITCH (  
    'All items - Tasks'[State Category],  
    "Proposed", 1,  
    "InProgress", 2,  
    "Completed", 3,  
    "Resolved", 4,
     5  
)  

The second one is a new table

1Proposed
2InProgress
3Completed
4Resolved
5 

and a column with

State Sort Order = 
RELATED( 'State Sort Order'[ID] 

but both come up with ofcourse the same Sort column. 

My idea is to first sort on the Sort column, and if the values are the same sort them on alphabetical order. 

 

Anyone?

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

i decided to give up on sorting by State Category and sorted on state itself. Thanks of the suggestions.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

You can consider to create a custom sort table and link to raw table, then use related sort table fields as sort order:

Custom Sorting in Power BI

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

As i've shown above i've tried this, but this does not work.

Anonymous
Not applicable

i decided to give up on sorting by State Category and sorted on state itself. Thanks of the suggestions.

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