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! Learn more

Reply
Anonymous
Not applicable

Sort by another column error

I am trying to sort by another column, and I'm getting the popular error, we can't sort the column X by Y. There can't be more than one value, yada, yada, yada. 

 

I created a numeric sort column using a switch function based on the values in another column. I went into the table view, filtered the table by each sort value, and confirmed there is one sort value for one value I'm trying to sort. No luck. I even copied the original field (the same exact values) to a new field, tried sorting, and got the same error. How is that even possible? 

 

Is there some known bug? Any help is appreciated.

 

Thank you,

Ed

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Ryan,

 

Unfortunately, I can't share this data. However, I built the logic for the table, including the sort field, in SQL rather than PowerBI (DAX), and it's working as expected. Thanks for your responses. 

View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

could you pls provide some sample data?

if you want to sort the column X by Y, then there must be one to one relationship between these two columns.

11.PNG

 

if there is a one to many relationship between columns , then you can't do that

12.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi Ryan,

 

Thank you for the response. There is a one-to-one relationship with the fields. Attached is a screenshot of the two fields added to a table. As you can see, there isn't a one-to-may relationship between the fields. 

Sort Screenshot.JPG

could you pls provide the pbix file?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi Ryan,

 

Unfortunately, I can't share this data. However, I built the logic for the table, including the sort field, in SQL rather than PowerBI (DAX), and it's working as expected. Thanks for your responses. 

I was getting the same error. And like you, my values had one to one relationship. I saw a mention elsewhere about using a conditional column. So I did that and it worked. In Power Query I added a conditional column, using your Type values and assigning the Sort value. 

a27279_0-1717635330395.png

 

Anonymous
Not applicable

Thank you - I tried this as well and it didn't work. 

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