Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
09
Helper I
Helper I

Power Query slows down after merging two queries

Hello,

could someone help me to refresh this query faster. It takes almost 15 mins to give me a result.

I'm using the filter function at the end because i got redundant lines with zero value for each column which is strange for me and i guess if you would help me out to get rid of these lines without filtering down after, it will make the refreshing super faster. 

Thank you for your help!

 

 

let
Source = Table.NestedJoin(#"HISTORIQUE MB52", {"CLE", "Date"}, #"UPS STOCK", {"material_Sloc", "Date"}, "UPS STOCK", JoinKind.LeftOuter),
#"UPS STOCK développé" = Table.ExpandTableColumn(Source, "UPS STOCK", {"Account", "Ref 5 ", "Designator", "UPS QTY"}, {"Account", "Ref 5 ", "Designator", "UPS QTY"}),
FilterRows = Table.SelectRows(#"UPS STOCK développé", each [UNR] <> 0 or [Blocked] <> 0 or [Returns] <> 0 or [UPS QTY] <> null)
in
FilterRows

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @09 ,

 

Difficult to say without understanding the actual data and source.

Whilst there are a number of ways to speed up merges when the data and source are understood, my first recommendation will always be: don't do the merge at all. Merging is very expensive in Power Query (obviously excluding when folded to source), so I would do the following:

1) In both Table1 (#"HISTORIQUE MB52") and Table2 (#"UPS STOCK") create a merged column, called something like 'CLE_Date'. In Table1 this will be [CLE] and [Date] merged together, in Table2 it will be [material_Sloc] and [Date]. In both I would also add a delimiter, such as '-', between them to help avoid false positives.

2) Remove any columns from Table2 that you don't need, keeping at least your new [CLE_Date] column.

3) Send both tables to the data model and relate Table1[CLE_Date] to Table2[CLE_Date].

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

1 REPLY 1
BA_Pete
Super User
Super User

Hi @09 ,

 

Difficult to say without understanding the actual data and source.

Whilst there are a number of ways to speed up merges when the data and source are understood, my first recommendation will always be: don't do the merge at all. Merging is very expensive in Power Query (obviously excluding when folded to source), so I would do the following:

1) In both Table1 (#"HISTORIQUE MB52") and Table2 (#"UPS STOCK") create a merged column, called something like 'CLE_Date'. In Table1 this will be [CLE] and [Date] merged together, in Table2 it will be [material_Sloc] and [Date]. In both I would also add a delimiter, such as '-', between them to help avoid false positives.

2) Remove any columns from Table2 that you don't need, keeping at least your new [CLE_Date] column.

3) Send both tables to the data model and relate Table1[CLE_Date] to Table2[CLE_Date].

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors