Forum Discussion
GregT57
Apr 02, 2020Copper Contributor
Sorting table in Power Query produces different results to sorting same table in Excel
I have a power query table that includes as it's last step a sort of rows based on 4 fields 3 of which are numeric data type. The query loads the table back into a worksheet. In the worksheet i h...
FigNewts
May 01, 2024Copper Contributor
Great answer that helped me get to the root of it. I cannot remove my connections from the data model, but it helped me isolate the issue comes from the data model.
There is a data model in excel that may have different settings that override Power Query sorting. Under Data > Data Tools > Manage Data Model.
In here, I saw the trouble come had a weird sort applied, I set it as desired, and that did it for me!
Understanding the data model can be really helpful, especially when working with dates!
There is a data model in excel that may have different settings that override Power Query sorting. Under Data > Data Tools > Manage Data Model.
In here, I saw the trouble come had a weird sort applied, I set it as desired, and that did it for me!
Understanding the data model can be really helpful, especially when working with dates!
Rob_Combley
Jun 13, 2024Copper Contributor
Your post filled me with hope! But when I followed your directions to the data model in excel there were no sorts applied to any of the columns so I'm still stuck with my table in power query and in excel in different orders.
Can you see if I'm missing something or do you have any other suggestions?
- SergeiBaklanJun 14, 2024Diamond Contributor
In External data properties setting Preserve column sort/filter could be ON
If data type is Any and data is loaded to data model, it will be considered as text and return to Excel as text. Iven if values are looks like numbers. With the Power Query will sort them as numbers and Excel as texts.
Perhaps something else, it's better to have small sample file which illustrates an issue for this concrete case.