Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Remove Duplicates Leaving Only Most Recent Documents

Giving Mr. Beug all the credit for his work in the two year old post below, I have a similar issue. My first attempt at achieving my goal is below.

 

My need: Remove ALL Duplicate titles of four out of 20 types of CQTitles, displaying only the most recent of those four in the table items and graph tallies. All training documents are in the database. All certification should appear (since there are no duplicates of those docs). Only the most recent qualifications should appear, even if there may be duplicates in the data set.

 

The four CQTitles for which no duplicates should appear; rather only the most recent: Medical, Live Fire Refresher, Self-Contained Breathing Apparatus Fit Test

 

let
     Source = SharePoint.Tables("https://SiteName/", [ApiVersion = 15]),
     #".........." = Source{[Id=".........."]}[Items],
     #"Renamed Columns" = Table.RenameColumns(#"..........",{{"ID", "ID.1"}}),
     #"Extracted Date" = Table.TransformColumns(#"Renamed Columns",{{"DteofCQ", DateTime.Date, type date}}),
     #"Sorted Rows" = Table.Sort(#"Extracted Date",{{"DteofCQ", Order.Descending}}),
     #"Buffer Table" = Table.Buffer(#"Sorted Rows")
in
     #"Buffer Table"