Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bdehning
Post Prodigy
Post Prodigy

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.   

 

Matrix Table.PNG

7 REPLIES 7
bdehning
Post Prodigy
Post Prodigy

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

Matrix BI.PNG

 

 

 

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?

 

Hi @bdehning ,

Please have a try.

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

vpollymsft_0-1654477238020.png

Then:

vpollymsft_1-1654477289066.png

Then select the SUBJECT column, sort by the custom.

vpollymsft_2-1654477346646.pngvpollymsft_3-1654477361002.png

 

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.

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

v-rongtiep-msft
Community Support
Community Support

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)

vpollymsft_0-1653443183806.png

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.

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.  

Nathaniel_C
Super User
Super User

Hi @bdehning ,

If you would share your pbix, or dummy up some values in Excel both for current and expected data. Please copy and paste them into your post, rather than doing a picture, we may be able to help you. 

Please read this post to get your question answered more quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ebeery
Solution Sage
Solution Sage

@bdehning to re-order the columns, you'll need to add a custom sort order.  See article below:

https://www.excelnaccess.com/custom-sorting-in-power-bi/ 

To filter to top 5 cities, you can use a Top N filter on the matrix visual.

ebeery_0-1653258092152.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.