Forum Discussion

droecher's avatar
droecher
Regular Visitor
3 years ago
Solved

Powerquery: creating a new subset table by last date

Hello,

 

I have a table containing chronological snapshots of some data which keeps growing by adding new snapshots and adding new entries:

 

snapshot-dateentry-idmeasurement
06/07/2023001some numerical value
06/07/2023002some numerical value
06/07/2023003some numerical value
06/01/2023001some numerical value
06/01/2023002some numerical value
05/15/2023001 some numerical value
05/15/2023002some numerical value

 

I would like to create a NEW table which will only contain the entries from the LATEST snapshot, whatever that is:

 

snapshot-dateentry-idmeasurement
06/07/2023001some numerical value
06/07/2023002some numerical value
06/07/2023003some numerical value

 

I assume this is basic stuff, but somehow neither google nor the other forum-entries have led me in the right direction.

Your help is much appreciated.

  • droecher 

    Table.SelectRows(#"Changed Type", let latest = List.Max(#"Changed Type"[#"snapshot-date"]) in each [#"snapshot-date"] = latest)

2 Replies

  • smpa01's avatar
    smpa01
    Community Champion

    droecher 

    Table.SelectRows(#"Changed Type", let latest = List.Max(#"Changed Type"[#"snapshot-date"]) in each [#"snapshot-date"] = latest)
    • droecher's avatar
      droecher
      Regular Visitor

      Thank you - I just noticed, that the "filter latest" is available from the date filter options on the column, and it produced exactly the same code as your solution.