Forum Discussion
Filter column if Source.Name corresponds to Source.Name in last row
- Anonymous5 years ago
Hi flowgistics
Have been very busy lately. So you have all the files in one folder like this? And you want the archive data file and the latest version of xyz? Are you going to use the Date created or the date in filename to identify the latest version?
here is one using Date created
let Source = Folder.Files("folderpath"), #"Filtered Rows" = Table.SelectRows(Source, each Text.Contains([Name],"archive") or [Date created] = List.Max(Source[Date created])) in #"Filtered Rows"
Hi flowgistics
Have been very busy lately. So you have all the files in one folder like this? And you want the archive data file and the latest version of xyz? Are you going to use the Date created or the date in filename to identify the latest version?
here is one using Date created
let
Source = Folder.Files("folderpath"),
#"Filtered Rows" = Table.SelectRows(Source, each Text.Contains([Name],"archive") or [Date created] = List.Max(Source[Date created]))
in
#"Filtered Rows"
Hi Anonymous
Thanks that works!
Regarding using the filename instead: can you think of a solution using the current date in order to compare it to the closest date of a filename and then select this file?
- Anonymous5 years agoNot applicable
Hi flowgistics
you mean 20210815 extracted from filename and compare with today? Can't use the Max date...you might get some date in the future?