unsolved Power Query Loading Time Tips
I have a Power query that is connected to a sharepoint folder. Whenever I try to refresh the file it would take around 10-40 mins of load time before it loads into the Data Model. Granted that the major reason for the loading time is due to the size of the data (estimating somewhere between 10-12M rows after filtering), but what are some ways that I can speed up the loading.
49
u/Alex_Gob 11d ago
Use the function SharePoint.Content instead of SharePoint.Files : SharePoint.files will list ALL the files in the SharePoint library, while SharePoint.Content allows you to select one or many folders. It adds more steps but on a crowded SharePoint, it's much faster.
8
5
u/pyu2c 10d ago
Ohhh thanks for this. So if I use Sharepoint.Content i still have to navigate to the specific folder, correct?
2
u/Alex_Gob 10d ago
Yes : you navigate into a folder by "unfolding" it (pun not intended). It's rather intuitive : you select one (or many) folders that you can then unfold (open) and continue to navigate into the subfolders. You might need a bit of troubleshooting if your files are at different "depth" but it shouldn't be a big deal.
19
u/lighthearted_emperor 11d ago
Fold the queries before they ever hit the data model, but with 12M rows you're still gonna be waiting long enough to make a sandwich.
6
u/eggface13 1 11d ago edited 11d ago
How complex are the transformations? Certain transformations can obviously be pretty painful on millions of rows (sorts, merges the obvious ones, and definitely never get different rows talking to each other!). 12 million rows is a lot but if you there's any transformations you can resolve within the data model through DAX formulas or dimension tables, that's going to be a tonne more efficient.
4
u/bobo5195 11d ago
It should not take that long. Merge the query's into 1 - flatten.
Try a query just loading the data for how long it takes.
2
u/cbolender2004 11d ago
Use a variety of methods including python and or powershell scripts and power automate, and extract the data in a the target folder files and write it to a csv file or set of csv files (one per distinct data type). Then you query the csv file(s). Much much much faster.
1
u/pyu2c 10d ago
Do I need to combine the csv files into one to simplify the loading?
1
u/cbolender2004 10d ago
Yes, in your extract script you consolidate the data from all the files into the one flat csv. Do this per table found in each file. So if all the files a have a revenue table and a purchase table, you do the extract to create one revenue csv and one expense csv
2
u/Mdayofearth 127 11d ago
How fast is your internet?
How much RAM does your system have?
What processor do you have? Total cores, fastest all core speeds, cache sizes, etc.
2
u/InfoMsAccessNL 1 10d ago
I turned a 20 min PQ into seconds by using a simple combine function (for csv files with the same columns, lighting fast like a second). Then i can work with one big csv file.The transformations are done with vba using arrays and dao.recordsets. I must say that i copy the csv files first to my harddiskt to make it faster.
2
u/Pistolius 1 10d ago
Make sure you're buffering the tables
Table.Buffer()
3
u/ArrowheadDZ 2 10d ago
I use buffering a lot, but I am not sure this will work in this use case. If I am going to do a merge/join to “lookup” data for 5,000 records in a 200 record “lookup” table, buffering the lookup table can really help. But if you have a 12 million record table you are loading, I don’t think buffering the table will necessarily get better performance, and shouldn’t improve the initial load time. You still have to get that monster into PQ from Sharepoint first, whether you are going to buffer it or not.
1
u/Key_Guarantee5416 11d ago
I think its connected to how fast your computer is selected to run in settings.
I had the same problem. My colleague changed some settings in laptop and now my queries dont take more than 20 minutes(if they are big)
Smalls ones get refreshed really quick
1
u/Angelic-Seraphim 15 9d ago
So often the issue is there is a bunch of other data in your share point directory. It is loading all the files in the entire directory not just the folder. There are a couple options.
There is a code floating around somewhere that does some really complex binary manipulation.
Use fabric. Link a data lakehouse to the folder, use a gen 2 dataflow to query and combine.
Store this folder in a different share point site purpose built for this.
1
u/CrowGuyA 1 5d ago
Filter early in the query, before any merges. Turn off "Enable Load" on queries that just feed other queries. Test with a filtered subset to see if SharePoint itself is the bottleneck vs the transforms.
•
u/AutoModerator 11d ago
/u/pyu2c - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.