Forum Discussion
vishaln
6 years agoNew Member
Delete rows based on condition in M PoweQuery
Hi,
How can I delete the rows that do not contain highlighted cells? The highlighted cells contain the most recent order date for a particular customer id. I want to keep only the rows where the Order Date is the latest one and remove all other rows for a particular Customer ID.
When I apply remove duplicates on ORDERDATE then it shows the first Order Date for a particular Customer ID which is not useful for me.
Thanks for your help!
Hi,
In the Query Editor, right click on the first column and go to Group. Select Max in the function there.
Hope this helps.
3 Replies
- Ashish_Mathur
Super User
Hi,
In the Query Editor, right click on the first column and go to Group. Select Max in the function there.
Hope this helps.
- vishalnNew Member
Thanks a lot, Ashish!
- Ashish_Mathur
Super User
You are welcome.