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

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
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
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.