Forum Discussion

kgriendling's avatar
kgriendling
Advocate I
9 years ago
Solved

How Do I Avoid Alphabetical Sorting?

Hi All,

 

Total BI Newbie here. I have a list of costs being fed into my report, and it auto-sorted to alphabetical. I want it to show as its native sorting. How do I control this? The arrow on the column just swaps the alphabetical from ascending to descending...

  • Anonymous's avatar
    Anonymous
    9 years ago

    You need a numeric or alphabetic column that corresponds to that original sort order, then use that to sort.

16 Replies

  • Hi, 

     

    I am a newbie to Power BI. How do I sort my list of data in the TABLE visualization by the source spreadsheet, and not alphabetically?

     

    Thanks,

     

    Kevin

    • v-caliao-msft's avatar
      v-caliao-msft
      Microsoft Employee

      kgriendling,

       

      You coud create a sort columd based on your requirement, and then change the order in your table visual.

       

      Regards,

      Charlie Liao

      • kgriendling's avatar
        kgriendling
        Advocate I

        Thanks Charlie.

         

        This would work if I want it to sort by a certain column. But how do I get it to NOT sort. We have a specific order the original file is in, and we want it to show up that way, which is non-alphabetical nor numerical.

  • I find it hard to belive that PBI will have such a counterintuitive (and, under some circumstances, outright stupid) "feature" as a non-preventable sorting. So if I have a table where the first column is presented in some logical order (say, animals by ascending size - dog, horse, elephant), there is no way to preserve that order without resorting to all sorts of unnecessary gymnastics?

     

    Is there really no way to prevent it?

    • Anonymous's avatar
      Anonymous
      Not applicable

      RBear I'm not sure what the difficulty is. If you want a non-alphanumeric sort order, provide another column that has that order. Then under Modeling, select Sort By Another Column and choose the sort order column. So in your example, you would create two columns:

       

      Animal     SortOrder

      Dog          1

      Elephant   3

      Horse       2

       

       

      I don't know if that's what you're refering to as unnecessary gymnastics but I can't think of any simpler alternative.

      • RBear's avatar
        RBear
        Advocate I


        If you want a non-alphanumeric sort order, provide another column that has that order. Then under Modeling, select Sort By Another Column and choose the sort order column. So in your example, you would create two columns:

         

        Animal     SortOrder

        Dog          1

        Elephant   3

        Horse       2



        Yes, this works, but it entails more than you let on - in a model that may be complicated enough already, you have to add a column, add it to the table in the report, make sure you click "Don't Summarize" and then go through the the fun process of hiding it. Of course, you should remember to document the whole process for the benefit of those who are going to maintain the model after you.

        I don't know if that's what you're refering to as unnecessary gymnastics but I can't think of any simpler alternative.


        A simpler alternative would be to just make sorting optional - as in adding "Don't Sort" just under "Don't Summarize"...