Forum Discussion

rrhascall's avatar
rrhascall
Helper II
6 years ago
Solved

Sorting

Hello,

Hoping someone can please advise.

Is there a way to deactivate or remove the sorting on a visual or matrix?  My dataset is sorted the way I would like to see it, however, when I create a visual, it uses the my row or column fields as sorts by default and ignores the sorting of my dataset.  I would like to try and avoid putting my preferred sort value under Tooltips just so I can sort results correctly.

  • edhans's avatar
    edhans
    6 years ago

    You have to create a Sort By column. For example, if you have a file with Jan, Feb, Mar, Apr, it will not sort by month date, but alphabetically, so Apr, Feb, Jan, Mar. Useless. You want Jan to sort by 1, Feb by 2, Mar, by 3, etc.

     

    So create a column in your data set that has the desired sort you want. You have to create the column. You cannot sort your data and expect that to work. It won't.

     

    Then use the Sort By Columns functionality. See this article for details.

  • dax's avatar
    dax
    6 years ago

    Hi rrhascall , 

    The viusal will sort by the columns in visual, so if you want to sort visual by specific in dataset, you need to set sort by in model like below

     Then whe you use name column in visual, which will sort it by sort column.

    Best Regards,
    Zoe Zhi

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

10 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey rrhascall 

     

    In the PBIX file:

     

    1. Go to the Data view

    2. Go to the Modelling tab

    3. Click on the column you wish to sort

    4. Click the "Sort by Column" buttom in the ribbon and sort to your hearts content. 

     

    This sets the default sort pattern for that column even when it is used in visuals.

    • rrhascall's avatar
      rrhascall
      Helper II

      Appreciate the quick reply but as mentioned in my original post, i already have my dataset sorted via the method you outlined.  The issue is my visual includes sorting by default based on the fields that I'm using and ignores my dataset sorting.  I don't see away to remove the sorting from the visual itself.

      • edhans's avatar
        edhans
        Community Champion

        You have to create a Sort By column. For example, if you have a file with Jan, Feb, Mar, Apr, it will not sort by month date, but alphabetically, so Apr, Feb, Jan, Mar. Useless. You want Jan to sort by 1, Feb by 2, Mar, by 3, etc.

         

        So create a column in your data set that has the desired sort you want. You have to create the column. You cannot sort your data and expect that to work. It won't.

         

        Then use the Sort By Columns functionality. See this article for details.