Forum Discussion

hashtag_pete's avatar
hashtag_pete
Helper V
4 years ago
Solved

Changing sorting in matrix

Hello everyone,  two things I can't get my head around, maybe you can provide explanation / solution.    I have a matrix where I display the sum of a column and a percentage difference of two colu...
  • v-jingzhang's avatar
    4 years ago

    Hi hashtag_pete 

     

    Currently it is still not supported to sort by multiple columns in a Matrix visual.

     

    While this is supported in a Table visual. If you can conver the matrix into a table, you can Shift + click the column header you would like to add next in the sort order to add more columns to the sort order. See Power BI Desktop March 2020 Feature Summary - Multi-column sort for tables

     

    I found a solution with DAX in this thread (Matrix multiple Sort columns). You can tweak the measure and add it to the matrix, then sort by this measure column. You will probably hope to hide this measure column but I haven't found a good way to do that. 

     

    For the second question, the sorting isn't changed. The highlighted two product rows disappear in the second image because when you have the divide function without -1, it returns blank result for these two products (as their SUM(Sales[Sales Amount]) result is blank). When the function has -1, their results are -100% not blank, so they appear. 

     

    If you want to always show rows with blank values, you can right click on Category or Product field and select Show items with no data option. Or you can also add +0 to the function without -1, then blank values will be converted into 0 and appear in the matrix. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.