Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Reorder matrix columns and rows

Hi,  apologies if this has been posted, but I couldn't find it.

 

As you can see from the image below, my headers are in numerical/ alpahabetical order.  I would like to re-arrange them so they are in chronological order.  I have created another column which allocates them a number 1 to 5, so I can order them in some bar charts I have, but am unable to do this in a matrix.

 

  • Anonymous
    There is no way to tell the matrix what sort by to use for the columns - this is done automatically based on the column settings.

    Now that you have created the column in Power Query, please select the Duration column from the Fields pane on the far right. NOTE: You must click on the text for Duration (do NOT tick or untick the box next to it).

    When you selcect the Duration column, if you are using the latest version of Power BI, you will see a Column Tools tab appear in the ribbon as per the post by @FahranAhmed
    Click the Column Tools tab, then select Sort By Column.

    Note you should still have the Duration column selected, so choose PCSort2 from this list.

    Wait for Power BI to update, then your matrix should automatically reorder the columns for you.

    You can also remove PCSORT2 from the matrix as Duration will be using that column now to sort every time it is used in any visual (including column and bar charts)

8 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Icon for Community Champion rankCommunity Champion
    Anonymous
    It sounds like you know what to do - can you confirm that your column charts are working/sorting correctly? Sometimes I find that Power BI needs a reset, so try going to a different page and coming back, or try removing the column from the matrix and adding it back in.

    If that still doesn't work, and you have used the "Sort by Column" button as per the link amitchandak posted, then we will need to know more about how you have set up the matrix in order to help you and also would be helpful to see a screenshot of the column charts that are working so we can see how you have set those up in comparison.
    • Anonymous's avatar
      Anonymous
      Not applicable

      bar chart workingbar chart workingnew column added to sortnot an option to sort

      Hi, I hope these images help.

      • FarhanAhmed's avatar
        FarhanAhmed
        Icon for Community Champion rankCommunity Champion

        Option avaiable on Top Ribbon under Column Tools.

         

        When you will click on column in table then Column tools tab will appear