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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
LillyLegenda
Helper III
Helper III

Matrix: Sorting by columns

Hi, I may have a simple question, but I just cannot get it to work.

 

I have a Matrix and I would like the user to be able to click on BB, DD or Inv to sort by the column.

How is this possible? 

Thank you 🙂

 

LillyLegenda_1-1612255368489.png

 

LillyLegenda_0-1612255351899.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@LillyLegenda 

 I think you cannot sort by column.

 
Instead you can create New Column like below:


BB = IF(Sheet1[OrderType] = "BB",Sheet1[Volume],0)
DD = IF(Sheet1[OrderType] = "DD",Sheet1[Volume],0)
INV = IF(Sheet1[OrderType] = "INV",Sheet1[Volume],0)


Once done add these Columns to the "Values" and removed Order Type from "Columns". This will enable the sorting option as per your requirement.


Please find screenshots below:

 

Matrix1.jpg

Matrix2.jpg

Thanks,

Sandeep

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

@LillyLegenda 

 I think you cannot sort by column.

 
Instead you can create New Column like below:


BB = IF(Sheet1[OrderType] = "BB",Sheet1[Volume],0)
DD = IF(Sheet1[OrderType] = "DD",Sheet1[Volume],0)
INV = IF(Sheet1[OrderType] = "INV",Sheet1[Volume],0)


Once done add these Columns to the "Values" and removed Order Type from "Columns". This will enable the sorting option as per your requirement.


Please find screenshots below:

 

Matrix1.jpg

Matrix2.jpg

Thanks,

Sandeep

Thank you very much @Anonymous ! This is working fine. Maybe it is just me but I think it should be a normal feature in a matrix. 

Anonymous
Not applicable

Other way to resolve this is using inforiver premium visual which sorts any invdividual column. However its paid if you want to publish the file for users to view it.

 

Thanks,

This blog post provides a workaround without using multiple measures:

 

https://affinityworks.co.uk/power-bi-matrix-column-sort-sorted/

manikumar34
Solution Sage
Solution Sage

@LillyLegenda , 

 

Choose sort by column and order by Asc or Desc from 3 dot menu on the visula (...)

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




amitchandak
Super User
Super User

@LillyLegenda , Order by will sort Ascending or based on sort column. Create a sort column and mark that as sort column  for order by https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

I disucssed this type of case in video - https://www.youtube.com/watch?v=KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak. Sorry this is not helping me. 

I only have the option to sort by Type or Volume.

LillyLegenda_0-1612256265184.png

 

@LillyLegenda , there is no option for column(pivot) to sort -here it is OrderType . It will sort Ascending or based on sort column

 

Say I want sort descending

new columns

Order Type 1 = [Order Type]

Order TypeSort =rankx(all(Table), [Order Type] )

 

Mark Order TypeSort  as sort column for Order Type 1 and use that in sorting

I disucssed this type of case in video - https://www.youtube.com/watch?v=KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.