Push Filters to SQL Server for Power Query Performance
Exhibit
Refer to the exhibit.
```
let
Source = Sql.Database("server.database.windows.net", "AdventureWorks", [Query="SELECT * FROM Sales.SalesOrderDetail WHERE ModifiedDate > '2024-01-01'"]),
#"Filtered Rows" = Table.SelectRows(Source, each [OrderQty] > 10),
#"Grouped Rows" = Table.Group(#"Filtered Rows", {"ProductID"}, {{"TotalQty", each List.Sum([OrderQty]), type number}})
in
#"Grouped Rows"
```You are reviewing a Power Query that imports data from SQL Server. The exhibit shows the M code. The SQL query filters records after a date, then Power Query filters rows with OrderQty > 10, and then groups by ProductID. What is a potential performance issue with this approach?
Quick Answer
The correct answer is that the filter on OrderQty > 10 should be included in the SQL query to reduce the amount of data transferred. This is because Power Query loads all source data into memory before applying its own transformations, so filtering later in the M code means unnecessary rows are still pulled across the network and stored in the Power BI data model. By pushing filters to SQL Server, you leverage the database engine’s processing power and minimize memory consumption and network latency—a core principle of query folding. On the PL-300 exam, this concept tests your understanding of performance optimization in data loading, often appearing as a trap where candidates overlook that a downstream Power Query filter can be folded upstream into the SQL query. A common memory tip is “fold early, fold often”—if a filter can be pushed to the source, do it there first to keep your data pipeline lean and fast.
⚠ Common exam trap
The trap here is that candidates focus on the date filter or grouping as the main performance issue, but the most impactful optimization is moving the row-level filter (`OrderQty > 10`) into the SQL query to reduce data transfer, which is a classic 'query folding' concept in Power Query.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The filter on OrderQty > 10 should be included in the SQL query to reduce the amount of data transferred.
Pushing the `OrderQty > 10` filter into the SQL query reduces the amount of data transferred from SQL Server to Power Query. In Power Query, data is loaded into memory before transformations; filtering earlier in the source query minimizes memory usage and network latency, which is a key performance optimization in Power BI data loading.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The query will fail because the SQL query uses '>' with a string.
Why it's wrong here
The date is a string literal, which is valid in SQL.
- ✗
The SQL query should use a parameter for the date instead of a hardcoded value.
Why it's wrong here
Hardcoding is not a performance issue, though it's less flexible.
- ✓
The filter on OrderQty > 10 should be included in the SQL query to reduce the amount of data transferred.
Why this is correct
Filtering in SQL reduces data load; currently, all rows after the date are loaded.
- ✗
The grouping should be done in SQL to reduce data volume.
Why it's wrong here
Grouping in SQL would also reduce data, but the current approach is valid; the main issue is the filter.
Go deeper
Related to this question
About these practice questions
One of 217 original PL-300 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on PL-300
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. You are troubleshooting a Power Query transformation that groups sales data by ProductID. The query runs slowly and you suspect the filter is being applied after loading all rows. What change would improve performance by pushing the filter to the source?
hard- A.Disable the 'Enable load' option for the SalesTable
- B.Use CALCULATE in DAX to filter
- C.Add a 'Table.Buffer' step after the filter
- ✓ D.Replace the first three lines with a native SQL query that includes the WHERE clause
Why D: Pushing filter logic to the source database via a native SQL query with a WHERE clause reduces the amount of data loaded into Power Query. This leverages query folding, which allows the source (e.g., SQL Server) to perform the filtering before data is transferred, significantly improving performance for large datasets.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PL-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PL-300 exam.