Forum Discussion
Join/Merge not working properly
- 5 years ago
Hi Anonymous
What date format are you using? What date is 16/15/2015?
The dates in the PBIX don't match the images above but no matter, the query still works.
After doing the Group By Product ID on Max Date, treat the resulting table as your left table.
Treat your (earlier) duplicated table with all your data as your right table.
Then do a Left Outer Join matching the Date and Product ID columns to give you only 1 row per Product in your final table.
Here's the PBIX file.
NOTE: The image below is from your PBIX data, so doesn't look the same as the images you posted.
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up. - 5 years ago
let Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content], Custom1 = Table.FromRecords(Table.Group(Source,"ProductID",{"n",each Table.Sort(_,{"Date",1}){0}})[n]) in Custom1
I think this will help you https://exceleratorbi.com.au/remove-duplicates-keep-last-record-power-query/