TechBuzzPro

Power Query Refresh Slowdown: How to Trace It

· 7 min read · Apps & Browsers

In this article
  1. Background: Why Power Query Refresh Performance Varies
  2. How to Measure the Slowdown
  3. Common Causes of Sudden Slowdowns
  4. How to Isolate the Slow Step
  5. Fixes and Optimizations
  6. Comparing Power Query to Other Data Tools
  7. Frequently Asked Questions

When a Power Query refresh suddenly slows down, the cause is almost always one of three things: a change in the source data (volume, structure, or location), a step in the query that has become inefficient (like merging entire tables instead of filtered subsets), or a resource bottleneck (memory, network, or the Power Query engine itself). To trace it, you need to isolate the slow step, measure its duration, and compare it to a known-good baseline. This article walks you through a systematic diagnosis.

Background: Why Power Query Refresh Performance Varies

Power Query is the data transformation engine inside Excel (Get & Transform) and Power BI (Dataflows and Query Editor). A refresh is the process of re-running all your queries: connecting to sources, applying transformations, and loading the result into a worksheet, data model, or dataflow. The time it takes depends on several factors that can change between refreshes:

  • Source data volume: More rows or columns means more work.
  • Source data structure: A new column with a heavy data type (like large text or binary) can slow things down.
  • Query complexity: Number of steps, joins, merges, and custom functions.
  • Memory and CPU: Power Query runs in a single process; if your machine is low on RAM, it will spill to disk.
  • Network latency: If your source is on a remote server or cloud service, the time to fetch data can dominate.
  • Power Query engine version: Updates to Excel or Power BI can change engine behavior.

A sudden slowdown means something changed in one of these areas. Your job is to find which one.

How to Measure the Slowdown

Before you can trace a slowdown, you need to know exactly how long each query takes and where the time is going. Power Query provides built-in tools for this.

  1. Enable the query diagnostics: In Power Query Editor (Excel or Power BI), go to the Tools tab and click Diagnostics > Start Diagnostics. Then refresh your query. When done, stop diagnostics. This creates a diagnostic query that shows detailed timings for each step, including the time spent in the source, the time spent in transformations, and the time spent loading.
  2. Look at the step timings: The diagnostic query includes a table with columns like Query Name, Step Name, Duration (ms), and Data Source. Sort by duration to find the slowest step.
  3. Compare to a baseline: If you have a previous diagnostic or a rough idea of how long the refresh used to take, compare. A step that used to take 2 seconds and now takes 2 minutes is your culprit.
  4. Use a manual timer: For a quick check, you can also time the refresh with a stopwatch or by recording the start and end times in a cell. But diagnostics give you step-level detail.

Common Causes of Sudden Slowdowns

Once you have the slow step identified, check these common culprits:

1. Source Data Volume Increased

The most obvious cause. If your source file or database table grew significantly, the refresh will take longer. Check the row count of your source. If it doubled, expect the refresh to take roughly twice as long (or more if you have complex steps).

2. Source Data Structure Changed

If someone added a column with a very large text field, or changed a numeric column to text, Power Query may have to do more work. Also, if the data type of a column changed, Power Query might be doing implicit type conversions, which are slow.

3. An Inefficient Step Was Added

Sometimes a step like Merge Queries or Group By is added that joins entire tables. If the tables are large, this can be extremely slow. Check for steps that reference other queries and see if they are filtering before merging.

4. Network or Server Issues

If your data source is on a remote server, a slow network or a busy server can cause a sudden slowdown. Try refreshing the source directly (e.g., open the CSV or query the database) to see if the slowness is outside Power Query.

5. Memory Pressure

Power Query is memory-hungry. If you have other applications open, or if your machine is low on RAM, the refresh may slow down dramatically. Check your Task Manager for memory usage during a refresh.

6. Power Query Engine Updates

Occasionally, an update to Excel or Power BI changes the behavior of the engine, causing a performance regression. If the slowdown happened right after an update, this is a possibility. Check the release notes or forums for known issues.

How to Isolate the Slow Step

The diagnostic tools are the best way, but you can also do manual isolation:

  1. Create a copy of the query. In the query list, right-click and duplicate the query.
  2. Delete steps. In the duplicate query, delete steps from the end until the refresh is fast again. The last deleted step is the slow one.
  3. Test the slow step in isolation. If the slow step is a merge, try merging a small sample of rows first to see if the issue is with the merge logic.
  4. Check the query folding. If your source is a database, check if the query is folding (i.e., pushing transformations to the server). If a step breaks folding, it will pull all data locally, which is much slower. You can see a “View Native Query” option on some steps; if it’s missing, that step likely breaks folding.

Fixes and Optimizations

Once you’ve found the cause, here are common fixes:

  • Reduce source data: Filter earlier, or use a query on the source to return only needed rows.
  • Remove unnecessary steps: Look for steps that change data types, add columns, or expand records that aren’t needed.
  • Optimize merges: Always filter and reduce tables before merging. Use a join kind that matches your data (e.g., Left Outer instead of Full Outer).
  • Enable query folding: For databases, ensure your transformations are foldable. Avoid steps that force local processing, like adding an index column or using custom functions.
  • Increase memory: Close other applications, or increase the RAM on your machine. In Power BI, you can also adjust the “Data Import” memory limit in options, but be careful not to exceed physical RAM.
  • Use incremental refresh: In Power BI, you can set up incremental refresh to only load new data, drastically reducing refresh time.
  • Parallel loading: In Excel, you can enable “Enable parallel loading of queries” in the options, but this may increase memory usage.

Comparing Power Query to Other Data Tools

Power Query is not the only data transformation tool. If you are considering alternatives, here’s a quick comparison:

  • Power Query vs. SQL: SQL is often faster for large datasets because it runs on the server and can use indexes. Power Query is more user-friendly and works across many sources.
  • Power Query vs. Python/Pandas: Python gives you more control and can be faster for complex transformations, but requires coding knowledge.
  • Power Query vs. Alteryx: Alteryx is a paid tool with a visual interface and strong performance, but Power Query is free with Excel/Power BI.

Frequently Asked Questions

Why is my Power Query refresh slow all of a sudden?

A sudden slowdown is usually due to a change in the source data (more rows, new columns), a change in the query (new step), or a change in the environment (network, memory, or software update). Use diagnostics to pinpoint the slow step.

How do I see how long each Power Query step takes?

In Power Query Editor, go to the Tools tab and start Diagnostics. After refreshing, stop diagnostics and look at the diagnostic query for step durations.

What is query folding and why does it matter?

Query folding is when Power Query pushes transformations to the source database, so only the final result is returned. If folding breaks, Power Query pulls all raw data locally, which is much slower.

Can I speed up a merge in Power Query?

Yes. Filter both tables to only the rows you need before merging, and choose the appropriate join kind. Also, ensure the key columns have the same data type.

Does disabling the Power Query background refresh help?

In Excel, disabling background refresh makes the refresh synchronous, but it doesn’t speed up the query. It just prevents other operations from running concurrently, which might free up memory.

Is there a way to refresh only part of a query?

In Power BI, you can use incremental refresh to load only new or changed data. In Excel, you can refresh individual queries by right-clicking on them in the Queries pane and selecting Refresh.