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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Slow performance joining SQL Server table and Excel table

Hi folks,

I have a doubt about the behaviour of Power Query (using in Excel 365).

Scenario: 

• I import a table from an Excel file (~10k rows);

• I link to an SQL Server database (~3mm rows) - I'm not doing "select from table", instead i'm selecting the table in list (i read or view in someplace i don't remember that is the "correct way"?)

• In some moment, i make an inner join between the two tables (Excel and SQL Server);

 

In this last step, I noted that Power Query "download" the entire SQL Server table (~3mm rows) to make the join. For me, this makes sense and at same time does not.

 

I have permission to write what I need in the SQL Server, but I was trying to do entirely in Power Query, but the processing time doing on it is unacetable.

 

Is there any recomendation to improve performance doing it at the "best practices" or is this the expected behavior?

 

Best regards.

Orlando

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @Anonymous ,

yes that's a know issue. Query folding will not happen in your case.

But there's a workaround: Solved: Parameterized SQL Query with query folding - Microsoft Power BI Community

More details about the reasons: SQL-query folding bug still alive and sucking in PowerBI and PowerQuery in Excel – The BIccountant

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Also check the performance difference when you do the merge "the other way round". Instead of merging the SQL table to the Excel table, merge the Excel table to the SQL table.  Play with Table.AddColumn instead of Table.NestedJoin etc.

ImkeF
Community Champion
Community Champion

Hi @Anonymous ,

yes that's a know issue. Query folding will not happen in your case.

But there's a workaround: Solved: Parameterized SQL Query with query folding - Microsoft Power BI Community

More details about the reasons: SQL-query folding bug still alive and sucking in PowerBI and PowerQuery in Excel – The BIccountant

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors