Forum Discussion

quickbi's avatar
quickbi
Icon for Helper II rankHelper II
1 year ago

Order a table with a number -ERROR-

I'm creating a table in Power BI. I have a level2 and a level2order. I want to sort level2 by its number, but when I try to do so, I get the following error:

 

But as you can see, there are no duplicate values. Does anyone know why it's not working?

 

Thank you very much!

 

 

5 Replies

  • quickbi 

    This is very common error that you receive when you try to sort one column based on a different column with some defined sorting criteria. 

     

    In order to sort level2 column based on level2order for every unique value in level2 column there should be a unique sort order value in level2order column. For any value of level2 if there are two different values of level2order then you will get this error.

     

    So, please check on that. One easy way to find is, pull both level2 and level2order columns into a table visual and put the aggregation on level2order column as "Count(Distinct)" then you will be able to identify 

     

    Hope it helps

     

    Need a Power BI Consultation? Hire me on Upwork

     

     

     

    Connect on LinkedIn

     

     

     








    Did I answer your question? Mark my post as a solution!
    If I helped you, click on the Thumbs Up to give Kudos.

    Proud to be a Super User!


    • quickbi's avatar
      quickbi
      Icon for Helper II rankHelper II

      Hi

      Thanks for you reply, but as I shown in my initial post and now following your instructions, the problem persists

       

      • tharunkumarRTK's avatar
        tharunkumarRTK
        Icon for Super User rankSuper User

        quickbi 

        Which version of Power BI besktop you have installed?

        I remember in one of the previous version, due to some bug it use to through this error. And restarting the power bi file, resolved the issue. Can you try once?

         

        Of that does not help then delete the level2order column and recreate it and try again

         

        Need a Power BI Consultation? Hire me on Upwork

         

         

         

        Connect on LinkedIn

         

         

         








        Did I answer your question? Mark my post as a solution!
        If I helped you, click on the Thumbs Up to give Kudos.

        Proud to be a Super User!


  • Fowmy's avatar
    Fowmy
    Icon for Super User rankSuper User

    quickbi 

    In addition to tharunkumarRTK reply, I recommend checking for blank values in these columns, as multiple blank entries could be causing the issue. Additionally, if you use Tabular Editor and apply sorting by column, this can sometimes resolve persistent sorting problems.