r/excel • u/Unlikely_Solution_ • Aug 04 '26
unsolved Power query in Excel - Performances issue
Hello everyone !
I am looking for advice or critics about how i work and use power query. I am a mechanical enginner and i got the responsability to manage parts classification. For that we have a table written in a very specific format in an excel, this is my one and only source of data.
I then use Power Query to fetch this excel table and transform the table. The end goal is to have JSON generated based on that and spread accross multiple CAD software and database.
I started working on this 'transformation' month ago and it has taken a lot of work. Now we have 757 line in the source document spread into 25 query (4 final) with between 20 to 200 lines each.
The issue is to update this query it takes hours.
I know most of the query are in waterfall structure (depending on previous queries). The Excel file is save on sharepoint/cloud but locally saved and the file it's trying to access is also locally loaded. The weirdest thing is one of the first query will take 1100s when the second (who use the first in a merge) will take only 34s... I know Power query does optimization to fold the queries but still.
I also tried Table.Buffer with little to no result.
I have also spread in different step for maintability but i dont think that what cause the issue here.
Added a picture of the mess it is :

Maybe i could spread a bit more the query and use datamodel to link stuff but my guess is it is not going to improve. Result reccorded with VBA macro :

I am still trying to get more result to identify if it's comes from a specific query or if it comes from the source access time.
Edit :
Here is a bit more context. I have 4 JSON to create, LOV (List of Value), Properties, Classes and Node each has a very strict structure.
Here is a picture of the Properties_JSON from the documentation:

You can see, the Properties, need ID of the LOV, the ID include the revision (#001). To know the latest revision i must use the previous LOV query, to have the latest revision (by comparing with what has been imported), if there is a difference, the revision increase.
And so on for Classes and Nodes.
To be able to do that, from my single source (757 rows) i split into 4 queries using filters (isNode, isProperties, isClass, is LOV) etc... Then i usually dedup in case there is duplicates in the source file. After that i merge with the previous query to get the ID of the child object. Then i create a reccord of this, compare it with what have been imported previously, increase the revision of the current object if required. I then create the ReelID of the current object for futur merge. In the end, i remove all columns i dont need. Additonnaly, there is few edge cases where i need to get the parent to be able to manage Cardinality and Polymorphism.
•
u/AutoModerator Aug 04 '26
/u/Unlikely_Solution_ - 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.
9
u/chiibosoil 431 Aug 04 '26
Much of PQ's query folding is dependent on data source. If it is SQL server, heavy lifting is done by the server.
However, when source is Excel table... there is no query engine or server to push transformations to. All steps must be executed within PQ engine in local, im-memory process. So all table must be loaded as is, before all transformations are done locally.
There are several ways to speed up the process.
Alternately using VBA for entire steps and performing all transformation using variant array and collection(s)/dictionary can significantly speed up things. Note that collection is magnitude faster than dictionary if there is no need to retrieve item via key.
3
u/Weaver707 Aug 05 '26
Are any of the files xlsb file types? I know it is common to save space. These file types are difficult for power query to read and will take forever to load.
Also, joins, merges or grouping can be resource heavy actions, you can optimize them a little by sorting and filtering before you merge.
The other thing based on your naming conventions, are you using custom functions? These can also be a bit of a resource drain and increase file load times.
Check your settings to see if Fast Load is checked, this basically restricts all resources to the load instead of allowing other processes to be ran simultaneously.
2
u/No-Possession-2685 Aug 04 '26
One of the first things I'd try, is turning off Auto save and see if that helps. Every time a change is made, no matter how small, if your file is stored on share point it'll save the workbook. Give it a shot, and see how you go 👍
1
u/AdSpecialist666 Aug 05 '26
Would you mind sharing a bit more what kind of queries you are trying to run? My first hunch with those "long queries" is that the queries themselves are not optimized by Power Query. So it doesn't matter how much you cache the tables since the same queries might be run over and over again due to the complicated setup.
For things like this I would usually prefer loading the excels in Python and operate the queries programmatically exactly due to the performance (and also maintenance issues for multiple tables/files) you are having here. Just curious to see if I might be able to jump in here with the python/AI solutions I have.
1
u/Decronym Aug 05 '26 edited Aug 10 '26
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
15 acronyms in this thread; the most compressed thread commented on today has 19 acronyms.
[Thread #49075 for this sub, first seen 5th Aug 2026, 08:06] [FAQ] [Full list] ^[Contact] [Source code]