Forum Discussion

i820017's avatar
i820017
Resolver II
5 years ago
Solved

Descending Order

Hey Everybody,

I am trying to put the order of the columns in one of my reports in descending order by YearMonth in a matrix. Right now, it is in ascending order. I have tried using 'Sort by Column', but that only sorts the data in the table component of Power BI, not in the matrix in the UI. Does any one know how to fix this? It seems pretty basic, but it has me stumped 😁

 
 
 

The column titles are, in order, 20202, 20203, 202004, 202005, 202006, 202007, 202008, 202009, 202010.

I want the column titles to be reversed so that 2020010 comes first, then 202009, and so on.

 

Thanks

Dan

 

  • I just got it to work. I had to pull from a new table, join the table, and then it worked... thanks for your help

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    At the moment Power BI doesn't have the capability to sort the column order of a matrix; only the row order may be sorted. 

    A simple work around is to add a custom column in data view that reverses all the values and sort by that column. 

    For example, if I'm currently using [MMM YYY] in my matrix and sorting it by serial month....

    ...then I would add a new column with the following formula.

    This gives me a new column that I would then use for the 'Sort by column' option

    Which makes my matrix go from this: 

    To this: 

     



     

    • i820017's avatar
      i820017
      Resolver II

      I switched the sign of the YearMonth column, then I sorted by that new column, and it still didn't work. I am getting this.

       

       

  • FrankAT's avatar
    FrankAT
    Community Champion

    Hi i820017 

    use a column for sorting your YearMonth column (see figure). [1] and [2] are slicers sorted ascending and descending.

     

     

    With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
    FrankAT (Proud to be a Datanaut)