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
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
Super User
Super User

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

 


@ 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!:
The Definitive Guide to Power Query (M)

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?


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.