Power Query slow refresh and TABLE.BUFFER

%3CLINGO-SUB%20id%3D%22lingo-sub-2691481%22%20slang%3D%22en-US%22%3EPower%20Query%20slow%20refresh%20and%20TABLE.BUFFER%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2691481%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%2C%3C%2FP%3E%3CP%3Every%20much%20appreciate%20your%20help%20with%20this%3C%2FP%3E%3CP%3Ei%20have%20a%20workbook%20with%2050%20power%20queries%2C%20of%20which%2030%20need%20to%20refresh%20ALL%2C%20at%20the%20same%20time.%3C%2FP%3E%3CP%3Esome%20of%20them%20time%20out%20(i%20get%20the%20popular%20%22this%20query%20doesn't%20load%20with%20100%20secs%22%2C%20but%20not%20always%2C%20which%20is%20strange%3F%3C%2FP%3E%3CP%3Ei%20have%20been%20informed%20that%20if%20i%20DESELECT%20%22allowing%20data%20preview%20in%20the%20background%22%20then%20this%20could%20help.%3C%2FP%3E%3CP%3Ecould%20anyone%20inform%20me%20why%20this%20is%3F%2C%20and%20if%20its%20a%20good%20idea.%20-%20i%20don't%20need%20to%20work%20on%20the%20file%20whilst%20its%20refreshing.%3C%2FP%3E%3CP%3Ethe%20next%20point%20to%20improve%20speeds%20i%20have%20read%2C%26nbsp%3B%20was%20to%20add%20Table.Buffer%20to%20my%20source%20code%3F%3C%2FP%3E%3CP%3Ebut%20where%20do%20i%20put%20this%20%3F%3C%2FP%3E%3CP%3Emy%20code%20to%20my%20query%20(where%20all%20others%20are%20pointing%20to%20is)%3C%2FP%3E%3CP%3E%3D%20Table.NestedJoin(Class%2C%20%7B%22Column2%22%7D%2C%20myid%2C%20%7B%22Trnid%22%7D%2C%20%22myid%22%2C%20JoinKind.LeftOuter).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20how%20should%20this%20code%20read%20if%20i%20inserted%20the%20table.buffer%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%20for%20your%20help%20on%20this%2C%20its%20much%20appreciated%20as%20its%20taken%20so%20much%20time%20to%20get%20all%20the%20PQ's%20working%20and%20is%20just%20so%20frustrating%20that%20now%20it%20doesn't%20refresh%20properly%20on%20a%20consistent%20basis.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Esteve%20reeves%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2691481%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2692624%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20slow%20refresh%20and%20TABLE.BUFFER%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2692624%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1107273%22%20target%3D%22_blank%22%3E%40stever78%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20don't%20think%20disabling%20%22%3CSPAN%3Eallowing%20data%20preview%20in%20the%20background%22%20helps%20a%20lot%20with%20performance%2C%20it%20affects%20caches%20update%20in%20preview%20mode.%20Side%20effect%2C%20in%20preview%20mode%20you%20may%20have%20%22evaluation%20was%20cancelled%22%20yellow%20alert.%20Not%20critical%2C%20you%20may%20click%20on%20such%20query%20to%20refresh%20it.%20But%20again%2C%20that's%20mainly%20preview%20mode.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETable.Buffer()%20could%20improve%20performance%20a%20bit%2C%20could%20not.%20It%20fixes%20the%20table%20in%20memory%20and%20useful%20when%20you%20sort%20or%20remove%20duplicates%20in%20table.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAggregations%20like%20Table.NestedJoin%20could%20really%20affect%20performance.%20Depends%20on%20how%20your%20queries%20are%20designed%20Table.Join%20instead%26nbsp%3Bcould%20improve%20the%20performance.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EI'd%20recommend%20to%20check%20series%20of%20Chris%20Webb%20posts%20related%20to%20Power%20Query%20performance%2C%20one%20of%20them%20is%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fblog.crossjoin.co.uk%2F2020%2F06%2F07%2Foptimising-the-performance-of-power-query-merges-in-power-bi-part-3-table-join-and-sortmerge%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EChris%20Webb's%20BI%20Blog%3A%20Optimising%20The%20Performance%20Of%20Power%20Query%20Merges%20In%20Power%20BI%2C%20Part%203%3A%20Table.Join%20And%20SortMerge%20Chris%20Webb's%20BI%20Blog%20(crossjoin.co.uk)%3C%2FA%3E%26nbsp%3Band%20here%20you%20may%20find%20links%20on%20other%20post%20from%20this%20series.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2711032%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20slow%20refresh%20and%20TABLE.BUFFER%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2711032%22%20slang%3D%22en-US%22%3Ethanks%20for%20the%20reply%20sergei%2C%20i%20wil%20look%20into%20the%20table.join%20function.%3CBR%20%2F%3E%3CBR%20%2F%3Econcerning%20table.buffer%20though%2C%20do%20i%20insert%20that%20code%20at%20the%20start%20of%20my%20join%20query%20(above)%2C%20so%3CBR%20%2F%3E%3D%20Table.NestedJoin.Buffer(Class%2C%20%7B%22Column2%22%7D%2C%20myid%2C%20%7B%22Trnid%22%7D%2C%20%22myid%22%2C%20JoinKind.LeftOuter).%3CBR%20%2F%3Einstead%20of%3CBR%20%2F%3E%3D%20Table.NestedJoin(Class%2C%20%7B%22Column2%22%7D%2C%20myid%2C%20%7B%22Trnid%22%7D%2C%20%22myid%22%2C%20JoinKind.LeftOuter).%3CBR%20%2F%3E%3CBR%20%2F%3Ehow%20would%20i%20enter%20the%20code%3F%20Or%20does%20it%20not%20work%20for%20nested.join%20queries.%3CBR%20%2F%3E%3CBR%20%2F%3Ethanks%20for%20your%20help%2C%20best%2C%20steve%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Contributor

Hi ,

very much appreciate your help with this

i have a workbook with 50 power queries, of which 30 need to refresh ALL, at the same time.

some of them time out (i get the popular "this query doesn't load with 100 secs", but not always, which is strange?

i have been informed that if i DESELECT "allowing data preview in the background" then this could help.

could anyone inform me why this is?, and if its a good idea. - i don't need to work on the file whilst its refreshing.

the next point to improve speeds i have read,  was to add Table.Buffer to my source code?

but where do i put this ?

my code to my query (where all others are pointing to is)

= Table.NestedJoin(Class, {"Column2"}, myid, {"Trnid"}, "myid", JoinKind.LeftOuter).

 

so how should this code read if i inserted the table.buffer?

 

thanks for your help on this, its much appreciated as its taken so much time to get all the PQ's working and is just so frustrating that now it doesn't refresh properly on a consistent basis.

 

thanks

 

steve reeves

 

 

 

7 Replies

@stever78 

I don't think disabling "allowing data preview in the background" helps a lot with performance, it affects caches update in preview mode. Side effect, in preview mode you may have "evaluation was cancelled" yellow alert. Not critical, you may click on such query to refresh it. But again, that's mainly preview mode.

 

Table.Buffer() could improve performance a bit, could not. It fixes the table in memory and useful when you sort or remove duplicates in table.

 

Aggregations like Table.NestedJoin could really affect performance. Depends on how your queries are designed Table.Join instead could improve the performance.

 

I'd recommend to check series of Chris Webb posts related to Power Query performance, one of them is Chris Webb's BI Blog: Optimising The Performance Of Power Query Merges In Power BI, Part 3: Table.Jo... and here you may find links on other post from this series. 

thanks for the reply sergei, i wil look into the table.join function.

concerning table.buffer though, do i insert that code at the start of my join query (above), so
= Table.NestedJoin.Buffer(Class, {"Column2"}, myid, {"Trnid"}, "myid", JoinKind.LeftOuter).
instead of
= Table.NestedJoin(Class, {"Column2"}, myid, {"Trnid"}, "myid", JoinKind.LeftOuter).

how would i enter the code? Or does it not work for nested.join queries.

thanks for your help, best, steve


@stever78 

That could be like

step = Table.NestedJoin(
   Table.Buffer( Class ), {"Column2"},
   Table.Buffer( myid ), {"Trnid"},
   "myid", JoinKind.LeftOuter)

or

a = Table.Buffer( Class ),
b = Table.Buffer( myid ),
step = Table.NestedJoin(
   a, {"Column2"},
   b, {"Trnid"},
   "myid", JoinKind.LeftOuter)

Table.Buffer() do nothing but load the table into the memory. 

thanks for this sergei, ill try it and hope it works.
if i could ask one further question of you,
what does the FAST DATA LOAD do on power query settings. i have always turned this ON. As i seem to get the TIMEOUT errors when loading PQ'S.
i can obviously try it without but do you know what the point of it is or is it literally that it just loads PQueries's quicker., thanks steve

@stever78 

With "Fast Data Load" Excel/Power Query allocates maximum of available resources (CPU, memory) to query downloading. During that other processes could be unresponsive. Yes, it accelerates data loading but decelerates if not stops for a while other processes.

@stever78
Did you find a solution to the slow refresh issue?
I also have a big-time problem with my live data loading & refreshing speed... I've searched everywhere and found nothing...

@John_Proistakis 

IMHO, there is no universal solution. Depends on many things. What is your data source, do you use query folding, did you separate staging queries, etc, etc, etc.