Forum Discussion

robincard's avatar
robincard
Frequent Visitor
6 years ago
Solved

Sort Matrix by Year (descending)

Hi,   I have a matrix that looks like this:   Year   2018                                            2019        Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May Apples  1   ...
  • v-alq-msft's avatar
    6 years ago

    Hi, robincard 

     

    Based on your description, you can create a calculated column as follows.

    Rank = RANKX('Table','Table'[Year],,DESC,Dense)

     

     

    You may go to ‘Modeling’ ribbon, click ‘Sort by Column’, select ‘Rank’ column.

     

    Result:

     

    As a  workaround, you can also click ‘Edit Query’, go to Query Editor, choose ‘Add column’ ribbon, select ‘Conditional Column’.

     

    You may configure as follows, then go to ‘File’ ribbon, click ‘Close and Apply’.

     

    Then you can make ‘Year’ column selected, go to ‘Modeling’ ribbon, click ‘Sort by Column’, select ‘Custom’ column. Here is the result.

     

    If I misunderstand your thought, please show me your sample data and expected output. Do mask sensitive data before uploading. I am glad to solve the problem for you.

     

    Best Regards,

    Allan

     

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