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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jsralat
New Member

Sort by column getting "same value" error

Hello, 

 

I am trying to sort my data by Month, so that it appears in the correct month order in my various visuals. 

 

There are multiple lines per month based on client data, each line with the corresponding Month and Period (month number).

jsralat_0-1714411405536.png

 

I am getting the error "We can't sort the 'Month' column by 'Period'. There can't be more than one value in 'Period' for the same vlue in 'Month'. Please choose a different column for sorting or update the data in 'Period'."

I have tried adding a calculated column for month number and sorting that way. Same error.

 

I have tried adding a conditional column and feeding it every month name and month number and sorting that way. Same error.

 

I have double checked my data. Every line has the correct month name and correct corresponding month number. 

 

Any other ideas?

 

Thanks~

3 REPLIES 3
Greg_Deckler
Super User
Super User

@jsralat I cannot recreate this. See PBIX. The most obvious cause for this would be some type of mismatch between your two columns like a "January" and a 2 or, a "January " and a 1. Note the trailing whitespace in the second example. Perhaps try applying a clean and trim operation on your Month column as well as Period just to be sure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I went back to my data and found two rows with (blank) for Month and Period. I assigned them a month and period just to test. I then also re-typed the months and corresponding month number in Period, ensuring they were consistent, just to make sure. Refreshed my data and I'm still getting the same error when I try to sort Month by any other column. I'm at a loss.

pborah
Impactful Individual
Impactful Individual

I have the same issue. I created custom size buckets column (B) for a numerical column (A). Then I created a custom sort column (C) using SWITCH() based on that custom buckets column (B). I get this error. Went through my entire data to ensure that one value of C corresponds to only one value of B. I still get this stupid error. This is beyond nonsensical. Sorting is such a breeze in tools like Tableau where you can even ctl+drag to sort them however you want. DAX is so painful in that it always makes you go the long way for even ridiculously simple things such as these!! 😫😡

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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