Forum Discussion

bdehning's avatar
bdehning
Post Prodigy
4 years ago

Matrix Table Column Sorting and Top 5

I have a Matrix Table that is close to what I want.  I set Column Field to Top 5 but how do I sort it so I get the reverse so it reads Strain, STF, MVA etc.  Also,  how could I get Top 5 for the cities on the Y Axis.   

 

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi bdehning ,

    Please refer to my pbix file to see if it helps you.

    Create measures.

     _all=SUMX(FILTER(ALL('Table'),'Table'[reporting location city]=SELECTEDVALUE('Table'[reporting location city])),[value-])
    
    sort = RANKX(ALL('Table'),[_all],,DESC,Dense)

    If I have misunderstood your meaning, please provide more details with your desired output.

     

    Best Regards

    Community Support Team _ Polly

     

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

    • bdehning's avatar
      bdehning
      Post Prodigy

      Thanks for trying. I still need to try the other posted solutions.  There is another field called Cause Groupings that brings in the COVID-19, Exposure, MVA, SATF and Strain which I filtered.     I want to see the top 5 cities as they show on the Image I posted.   I just want to see the columns sorted from decending so that first column of 152, 46, 28, 37, 12 is next to reporting location city column and all other columns follow 2-5.  

  • With your attched file I was able to get to the same place, so thank you.  

     

     

     

    Now, how would I get the sort to work on Columns to get them to read Strain, STF, MVA, Exposures, COVID-19 from left to right based upon some measure the count total.

    Column headings read asscending alphabetically towards total.  How to sort how I want to?

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi bdehning ,

      Please have a try.

      Click Home >>transform data>>Add column>>Conditional column.

      Then:

      Then select the SUBJECT column, sort by the custom.

       

      Best Regards

      Community Support Team _ Polly

       

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

      • bdehning's avatar
        bdehning
        Post Prodigy

        That takes into account the column headings only.   What if the highest number is under STF or another heading other than Strain?