Power Query List: A Step-by-Step Guide
In this article
Power Query lists are ordered sequences of values that you can create, transform, and expand to build cleaner tables. The quickest way to get one is to select cells in Excel and use Data > From Table/Range, then in Power Query use Transform > To List or enter a list literal like {1,2,3} in the formula bar. This guide walks through creating, editing, and using lists in Power Query, with practical examples and fixes for common errors.
What You'll Need
- Excel 2016 or later, or Power BI Desktop. Power Query is built in; no add-in is required.
- Basic familiarity with the Power Query Editor: the ribbon, the Queries pane, and the formula bar.
- Optional: a blank workbook or Power BI file to practise in. You can also use the Advanced Editor to paste M code.
Step-by-Step
- Open the Power Query Editor. In Excel, select a range of cells (or a table) and go to Data > From Table/Range. In Power BI Desktop, use Home > Transform data. The editor opens with your data loaded as a query. Menu labels can differ slightly by version, device, or region.
- Create a list from a column. Select the column you want to turn into a list. On the Transform tab, click To List. The column becomes a list value, shown in the formula bar as something like
Table.Column(#"Previous Step", "ColumnName")wrapped in a list. If you do not see To List, right-click the column header and look for it in the context menu, or use the formula bar to type= Table.Column(Source, "ColumnName")and then wrap it withList.Bufferif needed. - Enter a list manually. In the formula bar, type a list literal using curly braces:
{1, 2, 3}or{"Apple", "Banana", "Cherry"}. Press Enter. The query returns a list value. You can also useList.Numbers(1, 5)to generate 1 through 5, orList.Dates(#date(2024,1,1), 7, #duration(1,0,0,0))for a date series. - Convert a list to a table. With the list selected in the Queries pane, go to Transform > To Table. In the dialog, choose the delimiter (Comma, Semicolon, Tab, etc.) and click OK. Power Query creates a single-column table with your list values.
- Expand a list inside a cell. If a column contains lists (for example, after grouping), click the expand icon in the column header and choose Expand to New Rows. This duplicates the row for each list item and keeps other columns intact. Use Extract Values only if you want a delimited text string instead of separate rows.
- Transform list values. Select the list query and use the List tools on the Transform tab: List.Sum, List.Average, List.Count, List.Sort, List.Distinct, and List.Transform. For example,
List.Sum({1,2,3})returns 6. To apply a function to each item, useList.Transform(MyList, each _ * 2). - Combine lists. Use
List.Combine({List1, List2})to concatenate, orList.Union({List1, List2})to merge without duplicates. To intersect, useList.Intersect({List1, List2}). These functions are available in the formula bar and Advanced Editor. - Load the result. When your list or table is ready, click Close & Load (Excel) or Close & Apply (Power BI). A list value loads as a single-column table by default; if you need a table, convert it first as in step 4.
Common Mistakes
- Forgetting to convert a list to a table before loading. Power Query loads lists as one-column tables, but some downstream steps expect a table. Convert explicitly if you plan to merge or expand.
- Using the wrong delimiter when converting to a table. If your list contains commas, choose a different delimiter such as Tab or Semicolon to avoid splitting values incorrectly.
- Assuming Expand to New Rows works on any column. It only appears for columns that contain list or record values. If the icon is missing, the column is likely text or number, not a list.
- Mixing list and table functions. Functions like Table.SelectRows work on tables, not lists. Use List.Select for lists. Check the formula bar to see whether the step returns a list or a table.
- Ignoring case sensitivity. List.Distinct is case-sensitive by default. Use
Comparer.OrdinalIgnoreCaseif you need case-insensitive deduplication.
Tips
- Use
List.Bufferon large lists that are referenced multiple times to improve performance. - Name your list queries clearly in the Queries pane; list values are harder to identify than tables.
- Use the Advanced Editor to review the M code and spot whether a step returns a list or a table.
- When building a list from a column, consider using
List.RemoveNullsto clean up blanks before loading. - For date lists,
List.Dateswith a duration is more reliable than manually typing each date.
Troubleshooting
If To List is greyed out, make sure you have selected a column in a table, not a step in the Queries pane. If your list loads as a table with one column and you expected multiple rows, that is normal: a list is a single column. To split it into rows, use Expand to New Rows on the list column. If you see an error like "We cannot convert a value of type List to type Table", you are passing a list to a table function; wrap it with Table.FromList first. If Expand to New Rows is missing, the column may be text that looks like a list; check the data type and use Split Column instead. If the query is slow, add List.Buffer and avoid referencing the same list repeatedly without buffering. If you accidentally delete a step, use the Applied Steps pane to remove or reorder steps; you can also close without saving and reopen the file.
Frequently Asked Questions
What is a list in Power Query?
A list is an ordered sequence of values, written in M as {1, 2, 3} or {"a", "b"}. It can hold numbers, text, dates, or even other lists.
How do I create a list from a column?
Select the column in the Power Query Editor and use Transform > To List. The column becomes a list value in the formula bar.
Can I load a list directly to a worksheet?
Yes, but it loads as a single-column table. If you need multiple columns, convert the list to a table and then expand or split it.
How do I count items in a list?
Use List.Count(MyList) in the formula bar or Advanced Editor. For non-null counts, use List.NonNullCount.
Why does my list show as a table with one column?
Power Query represents lists as single-column tables when loaded. That is expected. Use Expand to New Rows if the list is inside a cell.
Can I combine two lists?
Yes, use List.Combine({List1, List2}) to concatenate, or List.Union to merge without duplicates.