# Power Query, Limit amount of data being loaded. Always want to load entire SQL server table



## Jeffrey Green (Aug 29, 2016)

[FONT=&quot]I am pretty new to PQ so forgive my butchery of the terminology.[/FONT]
[FONT=&quot]I have an excel spreadsheet with a table on it. About 40,000 rows.  Loaded in PQ to Connection only[/FONT]
[FONT=&quot]I can import that into a PQ with a problem.[/FONT]
[FONT=&quot]I need to compare those 40,000 rows against the data in an ODBC SQL Server connection with over 4 million rows.[/FONT]
[FONT=&quot]When i create the query for the SQLServer connection, i filter the date range to the last 90 days.  This should limit my table to about 90,000 rows.  I want to load this to a Connection Only, and i think i did that correctly. But when I close and load, PQ goes out and pulls all 4million rows, taking about 30 minutes.[/FONT]
[FONT=&quot]Then, when i merge the queries, using a left join, PQ again goes out and pulls all 4 million rows again.[/FONT]
[FONT=&quot]What do i have to do to get PQ to only load the ~90,000 Rows?  [/FONT]
[FONT=&quot]Part two of question.  When i merge these queries (i will have  three queries to merge total), do i load each query to Connection Only, and not to the Data Model, except for the last merged query that has my desired output, or should i be loading the query to the Data Model?  [/FONT]
[FONT=&quot]thanks [/FONT]


----------



## Scotland The Brave (Sep 8, 2016)

I would load to connection only until the last query. See this to get a better feel for how PQ interacts with SQL Server: Pass Parameters to SQL Queries - The Ken Puls (Excelguru) BlogThe Ken Puls (Excelguru) Blog


----------

