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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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~

2 REPLIES 2
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!:
The Definitive Guide to Power Query (M)

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.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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