SOLVED

Slow Power Query

%3CLINGO-SUB%20id%3D%22lingo-sub-2063174%22%20slang%3D%22en-US%22%3ESlow%20Power%20Query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2063174%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20new%20to%20Power%20Query.%20I%20have%20a%20sample%20file%20with%203%20Power%20Queries.%20The%20query%20takes%20a%20considerably%20long%20time%20to%20load%20the%20data%2C%20irrespective%20of%20no.%20of%20rows%20in%20the%20table.%20I%20have%20less%20than%2010%20rows.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20on%20why%20the%20slowness%20is%20much%20appreciated.%20I%20have%20attached%20the%20file%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMore%20Info%3A%20The%20queries%20are%20rather%20easy%20to%20read%20but%20I%20will%20explain%20them%20anyway.%3C%2FP%3E%3CP%3E1st%20Power%20query%20loads%20data%20from%20Table1%2C%20Removes%20certain%20columns%2C%20and%20Loads%20the%20remaining%20data%20into%20Table2%26nbsp%3B%3C%2FP%3E%3CP%3E2nd%20Power%20Query%20loads%20data%20from%20Table2%2C%20Removes%20certain%20columns%2C%20and%20Loads%20remaining%20data%20into%20Table3%3C%2FP%3E%3CP%3E3rd%20query%20does%20similar%20steps%20to%20the%20above.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20doing%20complex%20operations%20or%20transformations%2C%20yet%20the%20power%20query%20is%20slow.%3C%2FP%3E%3CP%3EPS%20%3A%3C%2FP%3E%3CP%3EI%20did%20check%20my%20system%20RAM%20and%20I%20have%208GB%20on%20a%20Windows%2010%20HP%20laptop.%3C%2FP%3E%3CP%3EI%20don't%20have%20any%20issues%20with%20loading%20other%20power%20queries%20so%20system%20slowness%20is%20ruled%20out.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20other%20steps%20like%20%22disabling%20change%20type%22%2C%20%22Fast%20data%20load%22%20etc%20but%20no%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2063174%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2063905%22%20slang%3D%22en-US%22%3ERe%3A%20Slow%20Power%20Query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2063905%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F929991%22%20target%3D%22_blank%22%3E%40Suresh1750%3C%2FA%3E%26nbsp%3BHave%20looked%20at%20your%20queries%20and%20believe%20you%20omitted%20a%20few%20important%20steps%20in%20your%20description%20of%20what%20you%20are%20doing.%20After%20loading%20a%20table%20back%20to%20Excel%2C%20you%20manually%20expand%20it%20(adding%20columns%20with%20data%20and%20formulae)%20before%20querying%20it%20again.%20And%20that%20you%20do%20two%20more%20times.%20Not%20sure%20that%20this%20is%20%22best%20practise%22.%20I%20suspect%20that%20this%20is%20causing%20your%20problem.%3C%2FP%3E%3CP%3EThen%20you%20also%20have%20all%20your%20queries%20set%20to%20refresh%20upon%20opening%20the%20file.%20That%20hung-up%20my%20Excel%20for%20quite%20a%20while.%20When%20I%20changed%20that%20setting%2C%20the%20file%20opened%20smoothly.%20Though%2C%20the%20queries%20still%20took%20long%20to%20open%2Freview%2Fedit.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2065255%22%20slang%3D%22en-US%22%3ERe%3A%20Slow%20Power%20Query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2065255%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3BYou%20are%20a%20lifesaver!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20downloaded%20Findlinks%20add-on%20and%20executed%20it%20myself.%20I%20wonder%20what%20those%20hidden%20links%20are%20and%20why%20would%20it%20be%20there%20in%20the%20temp%20location.%20I%20added%20the%20details%20of%20where%20I%20got%20the%20file%20from%20at%20the%20bottom%20of%20this%20response%20just%20in%20case%20if%20you%20are%20interested%20and%20also%20other%20folks%20who%20may%20be%20reading%20this%20response.%20Please%20see%20Gantt_Chart.xls%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EApproach%20and%20design%20decision%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EHowever%2C%20Regarding%20my%20approach%2C%20you%20mentioned%20%22%3CSPAN%3Eapproach%20you%20use%20doesn't%20work.%20You%20add%20manual%20columns%20with%20some%20data%2C%20but%20they%20won't%20be%20in%20sync%20with%20the%20main%20table%20returned%20by%20PQ.%26nbsp%3B%22.....%26nbsp%3B%22%20To%20resolve%20you%20need%20to%20query%20such%20table%20and%20merge%20with%20the%20main%20one%20on%20unique%20ID%20within%20the%20same%20query.%20%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EMy%20Requirement%20%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20First%20table%20under%20sheet%20Step1(Plan)%26nbsp%3Bis%20not%20a%20static%20table%2C%20it%20will%20grow%20with%20unique%20IDs%20generated%20on%20the%20fly%20whenever%20a%20user%20adds%20the%20row.%20The%20column%20Unique%20Item%20ID%20is%20to%20uniquely%20mark%20each%20row%20with%20an%20ID%20generated%20on%20the%20fly%20when%20a%20user%20adds%20the%20row.%20My%20current%20query%20loads%20that%20unique%20Item%20ID's%20into%20a%20table%20in%20the%20Step2(Do)%20sheet%20and%20I%20further%20use%20Xlookup%20to%20find%20additional%20data%20from%20the%20first%20table.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20the%20second%20table%20in%20sheet%20Step2(Do)%2C%20my%20requirement%20is%20that%20the%20users%20of%20this%20sheet%2C%20when%20they%20are%20ready%20for%20Step%202%20will%20add%20more%20details%20(for%20the%20same%20UniqueID%20they%20added%20in%20step%201).%20They%20don't%20want%20me%20to%20combine%20all%20the%20information%20that%20is%20needed%20in%20step%202%20into%20the%20Step%201%20table%20because%20users%20of%20the%20table%20will%20not%20have%20all%20the%20information%20during%20the%20Step%201%20process%20and%20they%20want%20a%20minimalistic%20approach.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ESo%2C%20with%20the%20approach%2C%20you%20suggested%2C%20I%20cannot%20use%20PQ%20merge%20if%20I%20don't%20know%20the%20Unique%20ID's%20to%20Merge.%20I%20am%20reading%20and%20loading%20the%20unique%20ID%20from%20the%20first%20table%20to%20the%20second%20table%20and%20use%20the%20Xloopup%20in%20the%20second%20table%20to%20find%20a%20few%20other%20details%20I%20need%20from%20the%20first%20table.%20In%20the%20case%20of%20sort%20and%20filter%20changes%20of%20the%201st%20table%2C%20My%20Xloop%20up%20should%20still%20find%20the%20correct%20data%20from%20the%201st%20table.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20could%20not%20think%20of%20any%20other%20way%20to%20know%20and%20load%20the%20Unique%20Row%20that%20is%20added%20in%20the%20first%20table%20except%20using%20PQ%20and%20XLookup(%20i%20have%20Xlookup's%20in%20the%20latest%20version%2C%20not%20in%20the%20version%20I%20shared%20with%20you).%20Please%20let%20me%20know%20if%20you%20think%20of%20any%20other%20design%20approach.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EMore%20about%20where%20I%20downloaded%20the%20file%20%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20downloaded%20the%20attached%20file%20from%20simple%20sheets.%20They%20have%20a%20one-time%20fee%20for%20various%20excel%20templates%20and%20Gannt%20charts%20which%20we%20can%20download%20and%20use%20for%20your%20project.%20I%20don't%20know%20if%20I%20need%20to%20trust%20these%20folks%20until%20I%20know%20what%20those%20links%20are%20for.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsimplesheets.co%2F%3Fgclid%3DCjwKCAiAl4WABhAJEiwATUnEF6bYVUpAxrf02FbtCCbt-mvDEGmk8CzLi19SknnbwpiOwOGuXT3hfBoCjEMQAvD_BwE%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsimplesheets.co%2F%3Fgclid%3DCjwKCAiAl4WABhAJEiwATUnEF6bYVUpAxrf02FbtCCbt-mvDEGmk8CzLi19SknnbwpiOwOGuXT3hfBoCjEMQAvD_BwE%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello,

 

I am new to Power Query. I have a sample file with 3 Power Queries. The query takes a considerably long time to load the data, irrespective of no. of rows in the table. I have less than 10 rows. 

 

Any help on why the slowness is much appreciated. I have attached the file

 

More Info: The queries are rather easy to read but I will explain them anyway.

1st Power query loads data from Table1, Removes certain columns, and Loads the remaining data into Table2 

2nd Power Query loads data from Table2, Removes certain columns, and Loads remaining data into Table3

3rd query does similar steps to the above.

 

I am not doing complex operations or transformations, yet the power query is slow.

PS :

I did check my system RAM and I have 8GB on a Windows 10 HP laptop.

I don't have any issues with loading other power queries so system slowness is ruled out. 

I tried other steps like "disabling change type", "Fast data load" etc but no help

5 Replies

@Suresh_Jayaraman Have looked at your queries and believe you omitted a few important steps in your description of what you are doing. After loading a table back to Excel, you manually expand it (adding columns with data and formulae) before querying it again. And that you do two more times. Not sure that this is "best practise". I suspect that this is causing your problem.

Then you also have all your queries set to refresh upon opening the file. That hung-up my Excel for quite a while. When I changed that setting, the file opened smoothly. Though, the queries still took long to open/review/edit.

Best Response confirmed by Suresh_Jayaraman (Occasional Contributor)
Solution

@Suresh_Jayaraman 

In your file there are few thousands of links on external files which are in hidden name. On Refresh Excel tries to update them and it takes time. Using FindLink (manville.org.uk)  I delete all of them.

As an example

hidden Name	BExCUSR1TLT2YXF5OVHCGT9D0CIS		='\\PHCHBS-S3047.EU.NOVARTIS.NET\SAULJA2$\DOCUME~1\bullimi1\LOCALS~1\Temp\N.notes.data\[FX effect LE2  Q3 September 13.xls]Table'!$I$11:$J$11	Deleted

In addition I'd recommend to set Ignore privacy setting for this file, you don't need it with this data structure.

With that Power Query itself works relatively fast.

Another story is that approach you use doesn't work. You add manual columns with some data, but they won't be in sync with the main table returned by PQ. You may change sorting of such table and refresh - values in additional columns will be on another positions. To resolve you need to query such table and merge with main one on unique ID within same query. 

Attached is the file in which removed everything except sheets with queries, you may check how it works.

 

@Sergei Baklan You are a lifesaver!

 

I downloaded Findlinks add-on and executed it myself. I wonder what those hidden links are and why would it be there in the temp location. I added the details of where I got the file from at the bottom of this response just in case if you are interested and also other folks who may be reading this response. Please see Gantt_Chart.xls

 

Approach and design decision:

However, Regarding my approach, you mentioned "approach you use doesn't work. You add manual columns with some data, but they won't be in sync with the main table returned by PQ. "..... " To resolve you need to query such table and merge with the main one on unique ID within the same query. "

 

My Requirement :

The First table under sheet Step1(Plan) is not a static table, it will grow with unique IDs generated on the fly whenever a user adds the row. The column Unique Item ID is to uniquely mark each row with an ID generated on the fly when a user adds the row. My current query loads that unique Item ID's into a table in the Step2(Do) sheet and I further use Xlookup to find additional data from the first table. 

 

In the second table in sheet Step2(Do), my requirement is that the users of this sheet, when they are ready for Step 2 will add more details (for the same UniqueID they added in step 1). They don't want me to combine all the information that is needed in step 2 into the Step 1 table because users of the table will not have all the information during the Step 1 process and they want a minimalistic approach. 

 

So, with the approach, you suggested, I cannot use PQ merge if I don't know the Unique ID's to Merge. I am reading and loading the unique ID from the first table to the second table and use the Xloopup in the second table to find a few other details I need from the first table. In the case of sort and filter changes of the 1st table, My Xloop up should still find the correct data from the 1st table. 

 

I could not think of any other way to know and load the Unique Row that is added in the first table except using PQ and XLookup( i have Xlookup's in the latest version, not in the version I shared with you). Please let me know if you think of any other design approach. 

 

 

More about where I downloaded the file :

I downloaded the attached file from simple sheets. They have a one-time fee for various excel templates and Gannt charts which we can download and use for your project. I don't know if I need to trust these folks until I know what those links are for. 

 

https://simplesheets.co/?gclid=CjwKCAiAl4WABhAJEiwATUnEF6bYVUpAxrf02FbtCCbt-mvDEGmk8CzLi19SknnbwpiOw...

@Sergei Baklan 

 

I cleaned up, added XLookup's, and attached FNS+2.xls. I will keep this for now and work on the approach you mentioned. 

 

With the help of another friend, I also found an article that explains the approach you mentioned,, the link is here :

 

https://social.technet.microsoft.com/Forums/en-US/e1c18dfc-fff2-4621-96a6-bd1a7a3903f4/how-can-i-add...

@Suresh_Jayaraman 

Yes, that's an idea. There are few blogs which describe the approach, I'm not sure who first introduced it.