Forum Discussion
wes-shen-poal
8 years agoHelper III
keep row based on a column for duplicate IDs in Power Query
Hi there,
i have a data table with columns ServiceDirectionCode and DateTo
I would like this data table to give me all the different ServiceDirectionCodes, and for the duplicate codes, I only want to keep the row with the latest DateTo.
Is this possible to do in the Query Editor?
Thanks,
Wes
Hi,
You may use the Group By feature and take the maximum of the DateTo column.
As Ashish_Mathur suggsted, just have your records group on Code level with max aggregation on Date column.
Regards,
3 Replies
- Ashish_MathurSuper User
Hi,
You may use the Group By feature and take the maximum of the DateTo column.
- v-sihou-msftMicrosoft Employee
As Ashish_Mathur suggsted, just have your records group on Code level with max aggregation on Date column.
Regards,
- wes-shen-poalHelper III