Forum Discussion

PowerBI_Yonghu's avatar
PowerBI_Yonghu
Frequent Visitor
7 years ago

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

  • Anonymous's avatar
    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?

    • PowerBI_Yonghu's avatar
      PowerBI_Yonghu
      Frequent Visitor

      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?


       

      • v-yuta-msft's avatar
        v-yuta-msft
        Community Support

        PowerBI_Yonghu ,

         

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

         

         

        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.