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
Anonymous
Not applicable

Sort by column not working

I have a Matrix and I want the Row item to be sorted in a specific order.

I created a column in Query Editor called 'Order' and i've used an IF statement to define the order as 01, 02, 03 etc. I ensured the column is a Whole Number

 

I've then sorted my Row item by the Order column in the Modelling tab, and it's made no difference to the order whatsoever!

 

Below are some screenshots, have I missed something obvious?

 

Screenshot1.PNGIn Query Editor, the Order column is 'whole number'Screenshot2.PNGThe M Query formula used to create the 'Order' columnScreenshot3.pngThe Row item is sorted by 'Order'Screenshot4.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Greg_Deckler

 

Wow do I feel stoopid. It had not occured to me to check WHAT order it was using. When I did, I realised it WAS using the right order. I must have had my Matrix sorted by something else, when I clicked on my Row Item to sort by that, it works!

 

Sorry for all the fuss!

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

I'm missing something, all of your Order's are 1?

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler

 

That's just a bad preview - if the P&L item is Gross Written Premium (which all of the first rows are) then the order number is 1. 

I have checked the full dataset and there are numbers 1-19 in there I promise. 

Anonymous
Not applicable

@Greg_Deckler

 

Wow do I feel stoopid. It had not occured to me to check WHAT order it was using. When I did, I realised it WAS using the right order. I must have had my Matrix sorted by something else, when I clicked on my Row Item to sort by that, it works!

 

Sorry for all the fuss!

OK, so what order are you seeing?

 

1

11

12

13

14

15

16

17

18

19

2

3

...

 

Or something else?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.