Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I have a folder that contains monthly files that go back years. For my purposes I only require the last 12 months. I filter the created date. This works fine, and the resultant import is limited to that data, however when I refresh the data I can see it is loading the filtered files before filtering them out. I.e. during the load I see "x MBs of january 2005.csv" And therefore the load takes forever!
Source = Folder.Files("Path")
Table.SelectRows(Source, let latest = List.Max(Source[Date created]) in each Date.IsInPreviousNDays([Date created], 730) or [Date created] = latest)
Hi @I_Like_Pi
Import all files once with Combine & Transform.
In the generated query list, apply your date filter in the “Transform Sample File” step, not the main folder query.
This way, Power Query filters early, before full load.
Thanks✨🌹
buttom kudo
That solved nothing. Using the folder import function provides a list of files with all of their file properties. This also includes the binaries themselves, and it appears PQ takes the time to load those binaries before you have had an opportunity to filter them from the list. It seems strange as you haven't yet defined how to translate the files yet (i.e. excel, csv, txt, ...). Regardless, in the end I built a Python to run in the background to copy out the current year files to a separate folder. This duplicates data, not what I wanted, but I moved on.
Power Query does NOT load the binaries until you open them on the initial load, so you can easily filter out data. It depends on where the files are being loaded from too. For example, by default, if you load files from SharePoint, it uses the SharePoint.Files() connector. But if you change it to SharePoint.Contents(), it can be much MUCH faster as it only has to load the metadata for the files in a specific folder, not the entire site.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting@I_Like_Pi
Power BI can only load the entire data then filter them out after. This is caused by huge amount of data to be processed, how many files and rows in your folder?
Take a look at my blog, try List.MaxN function.
Dynamically Display the Most Recent N Days using P... - Microsoft Power BI Community
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.