Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Sort by columns by value in Matrix Visual

I have a table contains ID and Week columns as below ID Week 001 Week1 002 Week2 003 Week2 001 Week3 003 Week3 003 Week3 And I use these 2 to create the Matrix ...
  • Sahir_Maharaj's avatar
    2 years ago

    Hello Anonymous,

     

    This isn't directly supported through standard sorting options, but you can achieve the result by creating a custom measure and using it to sort the matrix.

    SortByWeek3 = 
    CALCULATE(
        COUNT('YourTable'[ID]),
        FILTER(
            'YourTable',
            'YourTable'[Week] = "Week3"
        )
    )
    

    Add this measure to your matrix visual (You can add it as a hidden column if you don't want it to be displayed) and sort by the SortByWeek3 measure.

     

    Hope this helps.