Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am looking for the way to transform only recent files in each folder, containing different number of files. Example folder/file structure:
MainFolder
- Folder1
File1 2020-01-06
File2 2020-01-09
- Folder2
File6 2020-01-04
File7 2020-01-03
File5 2020-01-05
- ......
I need to process all the recent files in each subfolder of MainFolder, i.e. files:
File2 2020-01-09
File5 2020-01-05
How would I do that?
Thanks.
Solved! Go to Solution.
Add the following custom step after your Folder.Files step:
= Table.Group(Source, {"Folder Path"}, {{"LastestFile", each Table.Max(_, "Date modified")[Content], type binary}})
Oops, sorry about that... should really double check that it works first.
It should be:
= Table.Group(Source, {"Folder Path"}, {{"LastestFile", each Table.Max(_, "Date modified")[[Content], [Name]], type record}})
Add the following custom step after your Folder.Files step:
= Table.Group(Source, {"Folder Path"}, {{"LastestFile", each Table.Max(_, "Date modified")[Content], type binary}})
Yep, it works. Thanks @artemus !
Can you show how to add Name column to the result. Tried this one, but it returns back all the files:
Table.Group(Source, {"Folder Path", "Name"}, {{"LastestFile", each Table.Max(_, "Date modified")[Content], type binary}})
Sure, just change [Content] to [[Content,Name]]. Then expand the record column.
Table.Group(Source, {"Folder Path"}, {{"LastestFile", each Table.Max(_, "Date modified")[[Content, Name]], type binary}})
Does not want to work. Complains about comma after Content 😞
Oops, sorry about that... should really double check that it works first.
It should be:
= Table.Group(Source, {"Folder Path"}, {{"LastestFile", each Table.Max(_, "Date modified")[[Content], [Name]], type record}})
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
13 | |
11 |