Forum Discussion
Peter Downer
Feb 22, 2017Copper Contributor
Power Query not sorting Properly (Excel 2013)
Hello all, I am new to these forums so forgive if I am doing anything wrong. I have come across a problem with Power Query in Excel 2013. I am importing from a Table in a different Excel workbook, ...
claudiapeitzp
Aug 14, 2020Copper Contributor
Peter Downer I know it's been a long time but I've been looking for an answer to this problem for a long time and found it on an even older thread: unchecking the "Add this to the Data Model" option in the "Load To..." settings, makes the data sorting in the table the same as the one seen in the query preview.
Source: https://chandoo.org/forum/threads/power-query-sorting.23455/
- connordabronSep 02, 2020Copper ContributorThank you, this resolved my sorting issue
- SergeiBaklanAug 14, 2020Diamond Contributor
To sort correctly you need to fox the table in memory. IMHO, Load to data model is not the optimal way for that.
- claudiapeitzpAug 14, 2020Copper ContributorI’m not sure what you mean by fixing the table in memory but I tried multiple solutions (sort by index, changing the data type, etc) and this was the only one that worked. Unlike for instance Pivot Tables, I also found no special benefits or changes by adding the data to the model so this solution didn’t really take away any “optimality” for me, on the contrary.
- SergeiBaklanAug 19, 2020Diamond Contributor
You may fix in memory by using Table.Buffer(Table.Sort... or by adding Index column right before sorting and remove it after that if not needed.