Hi,
In the Main sheet, add this last step
Table.Buffer(#"Removed Duplicates")
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Check the screenshot where data is 26-05-2025 in main sheet and in merge sheet the data is pulled using merger query but resultant date is 21-04-2025 why? I have asked it with chatgpt also and it says its the way it is designed. What I understand is that after merge query it re-evaluates all steps and disregard the sorting order and then apply remove duplicate and pulls the result. in the main sheet i have applied sorting in descending order step. I have been using power query for more than a year and never doubted it, but this time it hits me. Imagine I need to calculate interest based on date pulled from another sheet and it pulls earlier date and I end up paying more on interest as it would calculate from 21-04-2025 and not from 25-05-2025. This is a serious issue that has questioned my faith in power query. I have always been confident regarding excel calculation and working until now.
Hi,
In the Main sheet, add this last step
Table.Buffer(#"Removed Duplicates")
I get how concerning this feel, and I want to help you lock this down reliably.
The issue comes from how Power Query handles row order and duplicates: when you use Remove Duplicates after a sort, the engine can re-evaluate and reorder during a Merge, so Table.Distinct may keep the first row in a new order, pulling the earlier date instead of the latest.
To make this deterministic, group by the key (e.g., Car) and return List.Max([Date]) as “LatestDate,” then merge to that aggregated query; or, if you prefer Sort + Distinct, add Table.Buffer right after the sort and before Table.Distinct to lock the order.
As a quick check, add a Group step to your Main Sheet, confirm the LatestDate per car, and re-run the merge.
If you still need the entire latest record, use Table.Group with Table.Max(_, "Date") instead of just the date.
Can you share the M code for your Main and Merge queries and confirm whether your source is folding (e.g., coming from Excel vs. a database)?
Also, do you need only the date or the full latest row for interest calculations?
Regards,
Aron