Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to disable sorting in Table visual

Hi,

 

I want to disable sorting on power BI table visual.By default table needs to be sorted based on first column.

How to achieve this?please help.

  • Hi Anonymous ,

     

    MFelixgave a wonderful work-around and that should probably suffice your requirement.

    You just need to follow below steps:

    1. Create a blank button or blank rectangle

    2. Place it over the Table columns (Make sure you place the blank button/rectangle infront of table)

    3. Group them together

     

    I'm not sure if you are using table visual or matrix visual but anyway, the drlling options at top right of visual box will be visible to you and you should be able to drill.

     

    With this work-around, you won't be able to perform any operations that are supposed to be related with clicking the table/matrix headers such as sorting in table/matrix and right click -> Drill in matrix.

     

    Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!

25 Replies

  • Hi Anonymous ,

     

    MFelixgave a wonderful work-around and that should probably suffice your requirement.

    You just need to follow below steps:

    1. Create a blank button or blank rectangle

    2. Place it over the Table columns (Make sure you place the blank button/rectangle infront of table)

    3. Group them together

     

    I'm not sure if you are using table visual or matrix visual but anyway, the drlling options at top right of visual box will be visible to you and you should be able to drill.

     

    With this work-around, you won't be able to perform any operations that are supposed to be related with clicking the table/matrix headers such as sorting in table/matrix and right click -> Drill in matrix.

     

    Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!

    • jfox0603's avatar
      jfox0603
      Frequent Visitor

      Sad that sorting capabilities in Power BI is so clumsy and ineffective that we have to resort to these measures to simply lock a column's sort order from modification.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Thanks for sharing this method. It works great for two of my matrix tables.  But it doesn't seem to work on my  third one, which has a lot of columns and I need to use horizontal scroll bar to go to the very end on the right.  

       

      Do you have suggestion on how to have it work on a matrix report that has a lot of columns with horizontal bar enabled?

       

      Thanks.

       

      • MFelix's avatar
        MFelix
        Super User

        Hi Anonymous

        The option is still the same only thing you need to garatee is that the shape fills all the wide of the table what I usually do is to create a shape a little large so if the table has 200 of wide I would do the shape with 205 for example. 

  • Hi Anonymous ,

     

    This is not possible since the sorting option is based on the column headers and it's a default behaviour, what you can do has a workaround is to make your table sorting as you need then create a blank button with the size of your table headers and place it on top of your table visualization then just group both of them and user will not be abble to select the order:

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your response.I have applied drill through in that table so will it work once i group button and table that if right click on any row it will drill through to next page? and also i have multiple columns in table so i need to scroll the table.

      • MFelix's avatar
        MFelix
        Super User

        Hi Anonymous ,

         

        I'm not sure about what answer you are refering to, but my answer of creating a button on top of the table will not disable the drilltrough and the scrolling since you should only place the button on top of the headers so to stop the users from clicking the header the scrolling is on the bottom and the drill trough should be made on a cell of the table so everything should work as expected.

  • sseverson12's avatar
    sseverson12
    Frequent Visitor

    Hi there,

     

    To save future readers some pain, the other answers given here are not correct and will cause serious problems for you if you need to prevent users from sorting using the column headers. The issue is that even if you group the blank button and the table visual together, if a user clicks somewhere else on the table visual (e.g. to scroll or select a row) the table will become selected and the user will then be able to sort using the column headers.

     

    Luckily, there is a solution if you put the visuals in separate groups. I found a great explanation here: https://www.youtube.com/watch?v=PKIcjGz_Swg

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your reply but It is not working as expected,I want to disable the sort option in Table visual

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi,

        I'm looking for a way to disable the sort option on my column in the visual. Have you found a solution to this ? Would love to know if you did 🙂 

  • negi007's avatar
    negi007
    Community Champion

    Anonymous  It may not be possible to disbale sorting option. I think as a workaround, you can draw a line on the top of the sort filter icon. This way sorting option will get hidden when user move cursor over the table which will indirectly disabled option to sort for the user

  • Anonymous's avatar
    Anonymous
    Not applicable

    I found a great way to do this. You just need to add an index column, sort by index column, and then make sure index column is hidden.

    • MFelix's avatar
      MFelix
      Super User

      Hi Anonymous ,

       

      This will sort the column but won't solve the issue for the lock of the sort since if your user click on any other column of the table or matrix it will resort by that specific one, and then if the user wants to revert back to the previous sorting then they can't because they will not see the index column.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thank you. Yes I am finding this out now. I am doing an internship using Power BI in the final throes of my degree, so I am still learning, on my own. I had it working for one table but not the other. In fact for the one that worked I later discovered I had the index column still there but literally hidden from view, as in it went off the page on the right side. Don't know if there's a way to lock the sort. There is no reason for users of my report to be able to sort. But anyway I may be publishing as a pdf on a website, it's quite simply a monthly publication for the local council, river flow rates in order of importance, so my method may work for that. I haven't found the rectangle overlay method to work just yet. Anyway I have more important things to focus on for now.