๐ฅ Get our brandnew Power Query exercise pack (including the GroupBy method): https://www.xelplus.com/course/power-query-challenge-pack/ Remove duplicates in Power Query, sort by date, keep the latest record. Logical, right? On a large file it can quietly hand you the wrong number, and nothing breaks to tell you. That's the trap in this video. You sort newest-first, remove duplicates to keep the top row, and the result looks fine. Then you run it on a bigger dataset and the count is wrong. No error. No warning. Just bad data going into your report. The cause is lazy evaluation. Power Query tries to be efficient and skips the full sort before removing duplicates, so it keeps an older record instead of the most recent one. I'll show you exactly how to spot it, how to check your work against the source, and the one-line fix: wrapping your sort step in Table.Buffer() so the whole table sorts in memory first. There's also a second method using Group By that doesn't rely on sort order at all. I cover that one in our Power Query exercise pack. ๐ Get the practice workbook: https://www.xelplus.com/power-query-keep-latest-record/#download ๐ Master Excel Power Query (full course): https://www.xelplus.com/course/excel-power-query/ โฑ๏ธ Chapters 00:00 The "Remove Duplicates" Power Query Trap 00:31 The task: finding the latest stock count 02:28 The "logical" way (sort + remove duplicates) 04:10 Checking the result against the CSV 05:03 Why Power Query kept the wrong record 06:10 The fix: Table.Buffer 07:41 A second method: Group By ๐จ Subscribe to "Between the Sheets" newsletter to stay on top of office tips and Excel hacks: https://link.xelplus.com/yt-d-newsletter ๐ Join this channel to get access to perks: https://www.youtube.com/channel/UCJtUOos_MwJa_Ewii-R3cJA/join ๐ฌ LINKS to related videos: Learn to Automate Everything with Power Query: https://youtu.be/x7mzOYEn0XA You WON'T BELIEVE These 10 HIDDEN Features in Power Query: https://youtu.be/8hjgmJk5RiA ๐ฒ Letโs connect on social: LinkedIn Leila: www.linkedin.com/in/leilagharani LinkedIn XelPlus: https://www.linkedin.com/company/xelplus Instagram: https://www.instagram.com/lgharani #Excel #powerquery

NEW: Copilot in Excel Finally Lets You Personalize It
828 views

It's not the sound of your voice.
18.4K views

Microsoft Quietly Added Email to Excel - Here's How to Use It
55.3K views

Work hard and you'll be noticed
74.5K views

Stop Sending Ugly Pivot Tables to Your Boss
599.5K views

The New Excel Trick to Link CSV Files Instantly
83.6K views