Forum Discussion

Lila05's avatar
Lila05
New Member
3 years ago
Solved

Remove dublicates, keep value based on another column

Hi,

 

I have a table with all operations on a production order. I could like to remove all duplicates BUT keep the latest operation. 

For example: Rows marked with purple is the one I would like to save based on latest date. How do I do that? Many thanks in advance for all efforts!

 

Production order no.OperationDate:
1a2023-02-18 18:20:15
1b2023-02-20 13:15:20
1c2023-02-20 14:30:00
2a2023-02-17 13:15:20
2b2023-02-20 15:30:00
3c2023-01-30 16:23:30
3d2023-02-05 07:12:59
   
  • Hi
    You can create a measure that filters the data depending on the operation no. and then checks if the selected date is the latest. I've done it like this:

    You can then add this measure to your table or just use it as a filter. This will only keep the latest dates for each production order no.:

    Hope this helps.

    Best regards.

3 Replies

  • Hi
    You can create a measure that filters the data depending on the operation no. and then checks if the selected date is the latest. I've done it like this:

    You can then add this measure to your table or just use it as a filter. This will only keep the latest dates for each production order no.:

    Hope this helps.

    Best regards.

    • Lila05's avatar
      Lila05
      New Member

      Thank you! It worked 🙂

    • Lila05's avatar
      Lila05
      New Member

      Hello again! 

      I wonder if you by any chance also know how to express this in power query?

       

      BR.