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
PowerBI_Yonghu
Frequent Visitor

Sort by another column no longer work

I have build an report which used a dummy numeric number (Seq) from 1-12 to sort my month name columns (Jan-Dec) which worked perfectly. 

 

But now I am getting an error saying "We can't sort the monthname column by numeric variable because more than one value for the same value in monthname". I double validated the data and its 1 to 1 meaning for each month name there is only one numberic number.

 

I have saved pre-existed report which worked where the sort by worked perfectly. The error occurs after I change the sortby to default and trying to remap it to the numeric sort by value (Seq).

 

Reporting_PeriodEnrMonthMonthNameSeq
Prior Period201704April1
Prior Period201705May2
Prior Period201706June3
Prior Period201707July4
Prior Period201708August5
Prior Period201709September6
Prior Period201710October7
Prior Period201711November8
Prior Period201712December9
Prior Period201801January10
Prior Period201802February11
Prior Period201803March12
Current Period201804April1
Current Period201805May2
Current Period201806June3
Current Period201807July4
Current Period201808August5
Current Period201809September6
Current Period201810October7
Current Period201811November8
Current Period201812December9
Current Period201901January10
Current Period201902February11
Current Period201903March12

 

Thanks in advance for the help.

 

4 REPLIES 4
Anonymous
Not applicable

Your Seq column has repeating values, so DAX doesnt know how to sort that data when there are two fields with, say, 1. Need to figure out some other logic so that there are not repeating figures. I dont know enough about your data to suggest anything though, but couldnt you just sort by your EnrMonth column?

Thanks for the suggestion. It worked well before which tells me it is able to reconize two rows with the same data. 

 

No, sort by enrMonth is not goingto work here becuase it's 1 to 2 match (One month name will get two EnrMonth) I will get the same error msg which now makes perfect sense.


@Anonymous wrote:

Your Seq column has repeating values, so DAX doesnt know how to sort that data when there are two fields with, say, 1. Need to figure out some other logic so that there are not repeating figures. I dont know enough about your data to suggest anything though, but couldnt you just sort by your EnrMonth column?


 

@PowerBI_Yonghu ,

 

Do you mean this error happens when you sort by [sep] in a visual like below?

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

The error occours in the data modeling tab sort by Column tab. I need to create a bar chart where monthName is sorted in order therefore I had to do it in the data modling tab (where error occurs).

 

Its somehow related to how data was loaded.  See my data below. Previously, I added a filtered rows in QueryEditor to limit the data to the latest ReleaseDate. Somehow it did not work this time, even I can not see any 2019Qtr1 rows but PowerBI still think its there. I fixed it by delete and reload the data. 

 

Thanks again for all the help.

 

Release DateYYYYMMMonthNameSeq
2019Qtr1201810Oct1
2019Qtr1201811Nov2
2019Qtr1201812Dec3
2019Qtr1201901Jan4
2019Qtr1201902Feb5
2019Qtr1201903Mar6
2019Qtr2201901Jan1
2019Qtr2201902Feb2
2019Qtr2201903Mar3
2019Qtr2201904Apr4
2019Qtr2201905May5
2019Qtr2201906Jun6

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.