Bird
Raised Fist0
Power BIbi_tool~20 mins

Query folding in Power Query in Power BI - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Query Folding Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is Query Folding in Power Query?

Which of the following best describes query folding in Power Query?

AThe process where Power Query translates steps into native queries executed by the data source.
BA method to manually write SQL queries inside Power Query editor.
CA feature that automatically compresses data files before loading.
DA way to create visual reports directly from Power Query.
Attempts:
2 left
💡 Hint

Think about how Power Query optimizes data retrieval from the source.

📊 Formula Result
intermediate
2:00remaining
Identifying Query Folding Status

You apply a filter step in Power Query on a SQL Server table. Which option correctly shows how to check if query folding is still active?

ARight-click the last step and select 'View Native Query'.
BCheck the 'Applied Steps' pane for a green checkmark.
CLook for a 'Query Folding Enabled' message in the status bar.
DOpen the Advanced Editor and search for 'fold'.
Attempts:
2 left
💡 Hint

Power Query provides a direct way to see the native query generated.

❓ Function Choice
advanced
2:00remaining
Which Power Query function breaks Query Folding?

Which of these Power Query functions will break query folding when applied?

ATable.Sort
BTable.SelectRows
CTable.RemoveColumns
DTable.TransformColumns with a custom M function
Attempts:
2 left
💡 Hint

Consider which function uses custom code that the data source cannot translate.

🎯 Scenario
advanced
2:00remaining
Optimizing Query Folding in a Complex Query

You have a Power Query that merges two large tables and then adds a custom column with a complex M expression. Which approach will best preserve query folding?

AAvoid merging and instead append the tables.
BPerform the merge first, then add the custom column in a separate step after loading.
CAdd the custom column inside the merge step using a native SQL query.
DAdd the custom column before merging the tables.
Attempts:
2 left
💡 Hint

Think about when custom M code breaks folding and how to isolate it.

❓ data_analysis
expert
2:00remaining
Determining Query Folding Impact on Performance

You notice your Power Query refresh is slow. You suspect query folding is broken. Which of the following observations best indicates that query folding is not happening?

AThe query uses only built-in Power Query functions.
BThe data preview loads instantly but the final load is slow.
CThe query refresh time is much longer than expected and 'View Native Query' is disabled.
DThe data source is a local Excel file.
Attempts:
2 left
💡 Hint

Consider what disables the 'View Native Query' option and how it relates to performance.

Practice

(1/5)
1. What is query folding in Power Query?
easy
A. It pushes data transformations back to the data source for faster processing.
B. It copies all data locally before applying transformations.
C. It disables all data refresh options.
D. It automatically creates charts from data.

Solution

  1. Step 1: Understand the concept of query folding

    Query folding means Power Query sends transformation steps back to the data source to run there.
  2. Step 2: Compare options with this definition

    Only It pushes data transformations back to the data source for faster processing. describes pushing transformations to the source for speed.
  3. Final Answer:

    It pushes data transformations back to the data source for faster processing. -> Option A
  4. Quick Check:

    Query folding = pushing steps to source [OK]
Hint: Query folding means running steps at the source, not locally [OK]
Common Mistakes:
  • Thinking query folding copies data locally first
  • Confusing query folding with data visualization
  • Believing query folding disables refresh
2. Which of the following Power Query steps supports query folding?
easy
A. Adding a custom column with complex M code referencing external files
B. Creating a manual index column
C. Merging queries with a local Excel table
D. Filtering rows based on a column value

Solution

  1. Step 1: Identify steps that can be folded

    Simple filters on source columns usually fold back to the database.
  2. Step 2: Analyze other options

    Custom columns with external references, merges with local tables, and manual indexes break folding.
  3. Final Answer:

    Filtering rows based on a column value -> Option D
  4. Quick Check:

    Filters fold, complex custom steps don't [OK]
Hint: Simple filters fold; complex or local steps usually don't [OK]
Common Mistakes:
  • Assuming all steps fold automatically
  • Thinking merges with local tables fold
  • Believing manual indexes fold
3. Given this Power Query M code, which step breaks query folding?
let
  Source = Sql.Database("Server", "DB"),
  FilteredRows = Table.SelectRows(Source, each [Status] = "Active"),
  AddedCustom = Table.AddColumn(FilteredRows, "Custom", each Text.Length([Name]))
in
  AddedCustom
medium
A. Source step
B. FilteredRows step
C. AddedCustom step
D. None, all steps fold

Solution

  1. Step 1: Check each step for folding support

    Source connects to SQL, supports folding. Filtering rows on a column also folds.
  2. Step 2: Analyze the AddedCustom step

    Adding a custom column with a function like Text.Length is done locally and breaks folding.
  3. Final Answer:

    AddedCustom step -> Option C
  4. Quick Check:

    Custom columns break folding [OK]
Hint: Custom columns usually break folding; filters don't [OK]
Common Mistakes:
  • Thinking all steps fold if source is SQL
  • Assuming filters break folding
  • Ignoring custom column impact
4. You notice your Power Query refresh is slow. Which fix helps restore query folding?
medium
A. Replace a custom column step with a simple filter step
B. Add a manual index column before filtering
C. Merge with a local Excel table before filtering
D. Disable the data source privacy settings

Solution

  1. Step 1: Identify what breaks folding

    Custom columns and merges with local tables break folding and slow refresh.
  2. Step 2: Choose a fix that restores folding

    Replacing custom columns with simple filters allows folding to resume.
  3. Final Answer:

    Replace a custom column step with a simple filter step -> Option A
  4. Quick Check:

    Simple filters restore folding, custom steps break it [OK]
Hint: Use filters instead of custom columns to keep folding [OK]
Common Mistakes:
  • Adding manual indexes early breaks folding
  • Merging with local tables breaks folding
  • Thinking privacy settings affect folding
5. You want to optimize a Power Query that merges a SQL table with a large local Excel table. How can you maximize query folding?
hard
A. Load the local Excel table to SQL before merging
B. Filter the SQL table first, then merge with the local Excel table
C. Merge first, then filter the combined table
D. Disable query folding to avoid errors

Solution

  1. Step 1: Understand folding with merges

    Merging with local tables breaks folding, but filtering source first keeps folding for that part.
  2. Step 2: Choose the best approach

    Filtering SQL table before merging reduces data and preserves folding on the source side.
  3. Final Answer:

    Filter the SQL table first, then merge with the local Excel table -> Option B
  4. Quick Check:

    Filter source before merge to keep folding [OK]
Hint: Filter source data before merging with local tables [OK]
Common Mistakes:
  • Merging before filtering breaks folding early
  • Assuming disabling folding helps performance
  • Not considering loading local data to SQL
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard