cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Sorting

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
Highlighted
Community Support
Community Support

Re: Sorting

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 it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: Sorting

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

Highlighted
Anonymous
Not applicable

Re: Sorting

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

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors