Forum Discussion

mm_engstrom's avatar
mm_engstrom
New Member
8 years ago
Solved

Top N Within Matrix Table

Hi, I have 3 columns of Data (Top 20 customers for 3 years). I would like to sort the table so it starts with the largest customer in the most recent year. Right now it seems like the 20 custoemrs a...
  • v-caliao-msft's avatar
    v-caliao-msft
    8 years ago

    mm_engstrom,

     

    Currently, we can not sort your table by using two different column. To work around this issue, you could create another column.

    Sample data

    And then create a table bu using the DAX below.

    Table =
    ADDCOLUMNS (
        TOPN ( 20, Table1, Table1[Amount], DESC ),
        "rank", RANKX ( Table1, Table1[Year] * 10000 + Table1[Amount] / 10000,, DESC )
    )
    



    Regards,

    Charlie Liao