Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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)
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
27 | |
25 | |
24 | |
13 | |
10 |
User | Count |
---|---|
25 | |
20 | |
20 | |
19 | |
11 |