Power Query List.Buffer: What It Does and How to Use It
In this article
List.Buffer takes a list and stores it in memory so that later steps in the same query do not have to rebuild it each time. It does not change the list's contents; it only changes how the list is evaluated. Use it when a list is expensive to compute and is referenced repeatedly, for example a list of dates, a distinct-values list used for filtering, or a lookup list joined against a large table. If the list is small or used once, buffering adds memory cost with little benefit.
What You'll Need
- Power Query in Excel, Power BI Desktop, or a Power Query-compatible tool. The function is the same across these hosts, though the surrounding editor labels can differ slightly by version, device, or region.
- A query that already produces a list, or a table you can convert to a list with a column reference such as
Table[ColumnName]. - Basic familiarity with the Advanced Editor or the formula bar, because List.Buffer is usually added as a manual step.
Step-by-Step
- Open your query in the Power Query Editor. In Excel, use Data > Get Data > Launch Power Query Editor (labels vary by version). In Power BI Desktop, use Home > Transform data. The steps below apply to both.
- Identify the list you want to buffer. It must be a list, not a table. If you have a table, create a list step first, for example by adding a step that references a column:
Source[CustomerID]. Name that step clearly, such asCustomerIDs. - Add a new step that wraps the list in List.Buffer. In the formula bar or Advanced Editor, write
BufferedIDs = List.Buffer(CustomerIDs). The first argument is the list; List.Buffer has no required second argument. - Change downstream steps to reference the buffered step instead of the original list. For example, if a filter step used
CustomerIDs, point it atBufferedIDs. This is the part people miss: buffering a list that nothing else references does nothing useful. - Check the step order. List.Buffer should appear after the list is fully built and before the steps that read it repeatedly. If the list depends on a parameter or a previous query, make sure that dependency is resolved before the buffer step.
- Close and load, or refresh the query, to confirm the result is unchanged. Buffering should not alter row counts or values; if it does, the problem is in the downstream step, not in List.Buffer itself.
- If the query is slow after buffering, remove the step and compare. Buffering trades memory for speed; on large lists it can increase memory pressure, so keep it only where it measurably helps.
Common Mistakes
- Buffering a table instead of a list. List.Buffer expects a list. Passing a table produces an error. Convert the table to a list first, usually with a column reference.
- Buffering a list that is used once. The buffer is created eagerly, so you pay the cost up front and get no reuse benefit. Use it only for lists referenced multiple times.
- Leaving downstream steps pointed at the original list. The buffer step exists but is never read, so performance does not change. Update the references.
- Expecting List.Buffer to remove duplicates or sort. It does neither. Use List.Distinct or List.Sort before buffering if you need those results.
- Assuming the buffer persists across queries. It is scoped to the query where it is defined. Other queries do not share it.
- Placing the buffer before a step that changes the list. If a later step appends or filters, the buffer holds the old version. Buffer the final list you actually want to reuse.
Tips
- Name buffer steps descriptively, such as
BufferedDateList, so the intent is obvious to anyone reading the query later. - Buffer lists that are used in joins, filters, or custom column logic where the same list is evaluated row by row. This is where the function pays off most.
- Combine List.Buffer with List.Distinct when you need a clean lookup list:
List.Buffer(List.Distinct(Source[ID])). - Keep an eye on memory in Power BI Desktop and the Power BI service; buffering very large lists can raise memory use. Test with a representative data volume.
- Use the query diagnostics tools available in your host to compare refresh times with and without the buffer step rather than guessing.
- Remember that List.Buffer is a performance hint, not a data transformation. Document why it is there so a future editor does not delete it as redundant.
Troubleshooting
If you get an error saying a table was expected or a list was expected, check the type of the step you passed in. A column reference produces a list; a whole table does not. Use the step's applied-step name and inspect it in the formula bar.
If the query is slower after adding the buffer, the list is probably small or used once. Remove the step and compare refresh times. If the list is large, check memory usage in your host; buffering can increase it.
If results change after buffering, the buffer is holding a version of the list from before a later transformation. Move the buffer step after the transformation, or point downstream steps at the correct step.
If the buffer step appears but downstream steps still behave as before, verify they reference the buffered step name and not the original. A typo in the step name will usually show as an error, but a correct reference to the wrong step will not.
If the query fails only on refresh in a service, check whether the list depends on a data source that is not available at refresh time. Buffering does not cache data across refreshes; it only avoids recomputation within a single evaluation.
Frequently Asked Questions
Does List.Buffer change the values in my list?
No. It stores the list in memory for reuse during the query's evaluation. The values, order, and duplicates are unchanged.
When should I use List.Buffer?
When the same list is referenced more than once in a query and building it is costly, such as a filtered or distinct list used in multiple downstream steps.
Can I use List.Buffer on a table column?
Yes, if you reference the column as a list, for example Source[ColumnName]. Passing the table itself will not work.
Does List.Buffer persist between refreshes?
No. The buffer exists only while the query is being evaluated. Each refresh rebuilds it.
Is List.Buffer the same as Table.Buffer?
No. Table.Buffer works on tables and List.Buffer works on lists. Use the one that matches the data shape you have.
Will List.Buffer make my query faster?
Only if the list is reused and expensive to build. For small or single-use lists it adds overhead with no benefit, so test before keeping it.