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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Walt1010
Helper V
Helper V

Simple Data Sort Problem

202307July  2023
202308August  2023
202309September  2023
202310October  2023
202311November  2023
202312December  2023
202401January  2024
202402February  2024
202403March  2024
202404April  2024
202405May  2024
202406June  2024
202407July  2024

I am getting an error in sorting by another column on a very simple case:

I have a Month Year (text) column, and a Year Month (number) column, and when I try to sort the former by the letter, I get the error message about not being allowed to have multiple values in the sort column for a value in the forth column. 

 

The Year Month number is just year * 100 + month.

There was a blank row that I filtered out, but otherwise the data is "clean". There are multiple rows with the same data in these columns.

 

Here is a sample of the (summary) data. Any suggestions would be appreciated.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Walt1010 , With Data I can see you should not face the issue 

 

So if your Data is in MMMM YYYY or MMM YYYY format and sort it on YYYYMM format it should work

 

Try creating the column again  like

 

Month Year = FORMAT([Date],"mmmm yyyy")
Month Year sort = FORMAT([Date],"yyyymm")

or

 

Month Year sort = year([Date]) *100 + month([Date]) 

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Walt1010
Helper V
Helper V

Using DAX to create the columns as you suggested, worked! I had previously created them using M. I'm not sure why there was a difference, but I'm glad I got over the problem. Thank you!

amitchandak
Super User
Super User

@Walt1010 , With Data I can see you should not face the issue 

 

So if your Data is in MMMM YYYY or MMM YYYY format and sort it on YYYYMM format it should work

 

Try creating the column again  like

 

Month Year = FORMAT([Date],"mmmm yyyy")
Month Year sort = FORMAT([Date],"yyyymm")

or

 

Month Year sort = year([Date]) *100 + month([Date]) 

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors