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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jsnadams
New Member

Sort by another column error : "We cannot sort the "foo" column by "bar"

I keep hitting this issue trying to sort by another column, where I have many incidents that occur in a single day, my goal is to sort the table first by calendar day, then by the incidents, in the order of most incients counts to least incident counts;

 

Sample Data;

DateIncidentsIncidentCount
11/8/2016IncidentA5
11/8/2016IncidentB50
11/8/2016IncidentC3
11/7/2016IncidentD100
11/7/2016IncidentE5
11/7/2016IncidentF70

 

This is the output I would like:

DateIncidentsIncidentCount
11/8/2016IncidentB50
11/8/2016IncidentA5
11/8/2016IncidentC3
11/7/2016IncidentD100
11/7/2016IncidentF70
11/7/2016IncidentE5

 

But I keep getting this error when I sort by another column:

 

"Sort by Another Column Error"  "We cannot sort the "foo" column by "bar".  You can't have more that one value in "foo" for the same value in "bar".  Choose a different column for sorting or update the data in "bar".

3 REPLIES 3
BhaveshPatel
Community Champion
Community Champion

You can use the matrix visualization to see the sorting by the calendar day and Incident Count.

 

Alternatively, You can also create a third calculated column to combine the two columns using CONCATENATE and do the sorting by that column.

 

sortingcolumn.PNG

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Thanks you for your response, but that is what I tried to do, but notice the Date column gets re-sorted, where I need to see most current date at the top, then I need to see IncidentCount sorted, my example I used Excel to do this (first sort one column, then sort a 2nd column), so I am hoping there is a way to also do this in Power BI?

Hi @jsnadams,

 

Currently, power bi visuals not support multiple columns sort, since others has already post this request, you can vote at below link:

Add a multiple columns sort featue

 

Regards

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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