Apr 02 2020 12:46 AM
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 have added some columns that test values in the current row to the previous row in order to set an Id field which is why it is critical that the table is sorted correctly.
I noticed that the results reflected in correct sorting so I then set sort parameters on the table in the worksheet which produced the correct results (by way of sorting the rows). but Excel asked me to accept treating looks like a number as numeric.
What I noticed is that the tables loaded from the query has all the numeric columns (per the query data type) showing as type "General". If I change the columns that are numeric to "Number" I end up with the same results as per the power query by way of incorrectly sorting the rows. I have checked 6 specific records that show problem and cn find nothing strange in their content.
Why do I get such huge difference between the query sorted rows result and the excel table sort?
Thanking you... Greg
Apr 02 2020 02:37 AM
Apr 02 2020 04:27 PM
Thanks for your reply and I have already checked that. The file in question is rather large but I will attempt to replicate the situation with a much smaller sample to illustrate my situation.
Aug 14 2020 06:25 AM
@GregT57 I've been looking for an answer to this problem for a long time and found it on an old thread deep down on my googling: 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/