Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have a Folder Source with a bunch of CSVs that goes into this folder automatically, but inside Power BI I just want to load the newest CSVs, where newsest = Today - 30 days. How can I do that? The column Date corresponds to the "Creation date" of the CSV.
Solved! Go to Solution.
Nice, using your answer as foundation, I found an even easier solution:
#"Filtered Rows" = Table.SelectRows(Source, each Date.IsInPreviousNDays([Date created], 30) or Date.IsInCurrentDay([Date created]))
Hi,
You need to load all the CSVs which are created within the last 30 days.
Or only one CSV which has been created exactly 30 days before Today ?
The folder will have all the CSVs since forever, but inside Power BI I just want to load and work with the CSVs which were created inside the frame "today - 30 days".
This is where I can filter, but I don't know how to express "today - 30 days" or something with the same effect in there.
You could use the 'is in the previous' menu with 30 days as a parameter. This will however not consider the csv of 'Today'.
Copy paste this code in the advanced editor (M) and adapt it to your need (update the source path).
let
Source = Folder.Files("YourSourcePath"),
DatesFlag = Table.AddColumn(Source, "Flag", each [Date created] <= DateTime.LocalNow() and [Date created] >= Date.AddDays(DateTime.LocalNow(),-30)),
KeepLast30Days = Table.SelectRows(DatesFlag, each ([Flag] = true))
in
KeepLast30Days
You can then peacefully combine the binaries (Column 'Content').
Nice, using your answer as foundation, I found an even easier solution:
#"Filtered Rows" = Table.SelectRows(Source, each Date.IsInPreviousNDays([Date created], 30) or Date.IsInCurrentDay([Date created]))
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.