Forum Discussion
hymieho
8 years agoResolver I
Combine multiple CSV files, then add IsLatest column based on date in filename in Power Query / M
I am importing a series of CSV file and they all have a date in the file name. Ex: 2017-09-26.CSV 2017-10-23.CSV etc. I am able to combine them and create a date column based on the filena...
- 8 years ago
Hi hymieho,
You can try a custom column like this:
List.Max(#"Changed Type"[Column1])
Best Regards,
Dale
v-jiascu-msft
8 years agoMicrosoft Employee
Hi hymieho,
You can try a custom column like this:
List.Max(#"Changed Type"[Column1])
Best Regards,
Dale
hymieho
8 years agoResolver I
Works like a charm--thanks for the tip!
1. Add a (temporary) custom column as you mentioned with the List.Max(date)
2. Add a 2nd custom column that checks to see if [Date] = [Latest Date in group]
3. Remove the temp column
#"Added Conditional Column" = Table.AddColumn(#"Added Custom", "IsLatest", each if [Add Column with latest date] = [Date] then "Yes" else "No"),
#"Renamed Columns2" = Table.RenameColumns(#"Added Conditional Column",{{"Add Column with latest date", "Latest Date in group"}}),
#"Removed Columns1" = Table.RemoveColumns(#"Renamed Columns2",{"Latest Date in group"})