Power Query Buffer: What It Does and How to Use It
In this article
Table.Buffer forces Power Query to load a table into memory once, so later steps read from that cached copy instead of re-evaluating the source or re-running expensive transformations. Use it when a query repeatedly references the same intermediate table, especially during merges or lookups against a slow source. It does not speed up every query, and it can increase memory use, so apply it deliberately. You need Power Query in Excel or Power BI Desktop and a query that already works correctly without the buffer.
What You'll Need
- Excel with Power Query (Data > Get & Transform Data) or Power BI Desktop.
- A working query that you have already loaded or previewed successfully.
- Basic familiarity with the Power Query Editor and the Advanced Editor or formula bar.
- A way to measure refresh time, such as the query diagnostics or a stopwatch on refresh, so you can tell whether buffering helps.
Step-by-Step
- Open your query in the Power Query Editor. In Excel, select a cell in the query output and go to Data > Queries & Connections, then right-click the query and choose Edit. In Power BI Desktop, use Transform Data or the Data pane. Menu labels can differ slightly by version, device and region.
- Identify the step that produces the table you want to reuse. This is usually a step after filtering, before a merge, or the step that reads from an external source. Click that step in the Applied Steps pane so the preview shows the table you intend to buffer.
- Decide where the buffer belongs. If the expensive work happens before the buffer, place Table.Buffer after that work. If you buffer too early, you cache a large unfiltered table and may slow things down.
- Add the buffer with the formula bar. With the step selected, click the formula bar (or fx button) and wrap the existing expression in Table.Buffer. For example, change
SourcetoTable.Buffer(Source), or change= Table.SelectRows(Source, each [Status] = "Open")to= Table.Buffer(Table.SelectRows(Source, each [Status] = "Open")). Press Enter to commit. - Alternatively, use the Advanced Editor. Open Home > Advanced Editor, find the step you want to change, and apply Table.Buffer around that step's expression. Keep the step name the same so later steps still reference it. Close the editor and confirm there are no syntax errors.
- Check the preview. The table should look identical to before. If the preview is blank or shows an error, undo the change with Ctrl+Z or by editing the step again.
- Refresh the query and time it. In Excel, use Data > Refresh All. In Power BI Desktop, use Home > Refresh. Compare against your earlier timing. A meaningful improvement means the buffer is helping; no change or a slowdown means you should remove it.
- If the query merges two tables repeatedly, buffer the smaller or slower side. Buffering the table that is read many times during a merge is the usual win. Do not buffer both sides unless you have measured a benefit.
- Save the query and, if needed, load it. In Excel, choose Close & Load. In Power BI Desktop, choose Close & Apply. Re-open the file and refresh once more to confirm the buffer survives normal use.
- Document the change. Add a comment in the Advanced Editor or rename the step to something like BufferedOrders so the next person knows why the step exists.
Common Mistakes
- Buffering the first step. This caches the raw source, which is often the largest table and the least useful to hold in memory.
- Buffering every step. Each buffer consumes memory; stacking them can make refresh slower and the file heavier.
- Buffering a table that is used only once. There is no reuse to benefit from, so the buffer adds overhead for nothing.
- Placing the buffer before a filter that removes most rows. Filter first, then buffer the smaller result.
- Assuming Table.Buffer fixes a slow source. If the source itself is slow on every refresh, buffering only helps within a single refresh, not across refreshes.
- Forgetting that buffering does not make a query streaming or incremental. It is an in-memory cache for the current evaluation.
Tips
- Measure before and after. Use Query Diagnostics in Power BI Desktop or time a full refresh in Excel. Without a baseline you cannot tell whether the buffer helped.
- Buffer the side of a merge that is read repeatedly, usually the smaller dimension table.
- Keep buffers close to the operation that reuses the table, not at the top of the query.
- Remove buffers you no longer need. A query that once benefited may no longer do so after other changes.
- Use Table.Buffer on tables, not on lists or records. For lists, List.Buffer exists but has different behaviour; do not substitute one for the other.
- If memory is tight, buffer less and filter more. A smaller buffered table is safer than a large one.
Troubleshooting
- The query errors after adding Table.Buffer. Check the parentheses and that the argument is a table. Table.Buffer expects a table expression, not a step name alone if that step returns something else. Undo and reapply carefully.
- Refresh is slower, not faster. Remove the buffer and confirm the original timing. The buffer may be caching a large table that is used only once, or the source may already be fast.
- Out of memory or file size grows. Reduce the number of buffers, filter earlier, or remove columns before buffering. Large buffered tables increase memory pressure.
- Results look different after buffering. This is rare but can happen if the source changes during refresh. Buffer after all source reads are complete, and refresh again to confirm stability.
- The buffer seems to have no effect. The query engine may already be folding or caching the step. Check query folding indicators where available; if the step folds to the source, buffering may not change performance.
- You cannot find Advanced Editor. It is on the Home tab in the Power Query Editor in both Excel and Power BI Desktop. If it is missing, you may be in a different view; switch to the Power Query Editor.
Frequently Asked Questions
Does Table.Buffer make my query faster?
Only when the same table is evaluated more than once in a single refresh, such as during merges or repeated lookups. For single-use tables it usually adds overhead.
Does buffering persist between refreshes?
No. The buffer is an in-memory cache for the current evaluation. Each refresh rebuilds it.
Should I buffer the source step?
Usually not. Buffer after filtering and column removal so you cache a smaller, more useful table.
Can I buffer a list instead of a table?
Yes, with List.Buffer, but it behaves differently and is not a substitute for Table.Buffer on tables. Use the function that matches the value type.
Does Table.Buffer work in both Excel and Power BI?
Yes, it is part of the Power Query M language available in both. The editor and refresh controls differ, but the function is the same.
How do I know if buffering helped?
Time a full refresh before and after, or use Query Diagnostics in Power BI Desktop. If there is no measurable gain, remove the buffer.