Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query List.Zip Function: Step-by-Step Guide

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

List.Zip takes two or more lists and combines them row by row into a single list of lists. That is the whole job: it pairs items by position, not by matching values. You need Power Query in Excel or Power BI Desktop and at least two lists of the same length (or an understanding of what happens when lengths differ).

What You'll Need

  • Excel (Power Query is on the Data tab) or Power BI Desktop.
  • Two or more lists, either hard-coded in the formula bar or produced by earlier steps.
  • Basic familiarity with the Power Query Editor: the formula bar, the Advanced Editor, and how to create a blank query.

Step-by-Step

  1. Open the Power Query Editor. In Excel, select any cell in your data and go to Data > From Table/Range. In Power BI Desktop, use Home > Transform data. If you have no data yet, use Data > Get Data > From Other Sources > Blank Query to start a query from scratch. Menu labels can differ slightly by version and platform.
  2. Create a blank query for testing (optional but recommended). In the Power Query Editor, go to Home > New Source > Other Sources > Blank Query. This gives you a clean place to experiment without touching your real data.
  3. Enter your first list. With the blank query selected, click the formula bar and type ={1,2,3} then press Enter. You now have a list. Repeat by creating a second blank query with ={"A","B","C"}. Naming queries helps: right-click each query in the Queries pane and rename them List1 and List2.
  4. Write the List.Zip expression. Create a third blank query and in the formula bar type =List.Zip({List1, List2}) . Press Enter. The result is a list of three items, each item itself a list: .
  5. Read the output correctly. Click on any item in the result list to see its contents in the preview below. Each row is a list, not a record. If you expected records with field names, you will need to convert them (see Tips).
  6. Expand the zipped list into a table. With the zipped list selected, go to Transform > To Table. In the dialog, leave the default and click OK. You now have a one-column table where each cell contains a list. Use the expand icon (the two arrows) in the column header and choose Expand to New Rows. That turns each inner list into its own row. If you want separate columns instead, use Extract Values or split the list manually with List.PositionOf and related functions.
  7. Apply it to real columns. If your lists come from table columns, reference them by name, for example =List.Zip({Source[Column1], Source[Column2]}). This works when both columns are lists of the same length. If a column holds text rather than a list, wrap it with Text.Split or convert it first.
  8. Handle unequal lengths. If the lists differ in length, List.Zip pads the shorter ones with null so the output length matches the longest list. Decide whether nulls are acceptable or whether you should filter or trim the lists before zipping.
  9. Close and load. When the query looks right, go to Home > Close & Load (Excel) or Home > Close & Apply (Power BI). The result lands in a new worksheet or table.

Common Mistakes

  • Passing lists as separate arguments. List.Zip expects a single list of lists: List.Zip({List1, List2}), not List.Zip(List1, List2). The latter throws an error.
  • Expecting value matching. List.Zip pairs by position. It does not look up matching keys. If you need to join on a key, use Table.NestedJoin or merge queries instead.
  • Forgetting that inner items are lists. Many people try to treat the output as records and reference field names. There are no field names unless you add them.
  • Ignoring null padding. Unequal list lengths silently introduce nulls. Check your row counts after zipping.
  • Using it on table columns that are not lists. A table column is a list, but if you reference a single cell that contains text, List.Zip will fail. Convert or split first.

Tips

  • Use List.Zip with List.Transform to convert each inner list into a record with named fields: List.Transform(List.Zip({List1,List2}), each [Column1=_{0}, Column2=_{1}]). That makes the output far easier to expand into columns.
  • Name your queries clearly before zipping. Referring to Query1 and Query2 is error-prone.
  • Test with small hard-coded lists first. It is much faster to debug three items than three thousand.
  • If you only need to combine two columns row by row, consider Table.AddColumn with a custom column instead of List.Zip. It is often simpler for table-shaped data.
  • Remember that List.Zip is not a join. If your lists are different lengths and you need alignment by key, restructure the data first.

Troubleshooting

Error: "We cannot convert a value of type List to type Text." You likely passed a list where a single value was expected, or you tried to display the zipped list directly in a table cell without expanding. Expand to new rows or extract values.

Error: "Expression.Error: The argument to function List.Zip must be a list." You passed separate arguments instead of a list of lists. Wrap them in curly braces: List.Zip({List1, List2}).

Output has nulls you did not expect. Your input lists have different lengths. Check each list's count with List.Count and trim or pad deliberately.

Nothing appears in the preview. Click the whitespace in the formula bar and press Enter, or click the step in Applied Steps to refresh the preview. If the query references other queries, make sure those queries load without errors.

It worked in a blank query but fails on your table. The columns you referenced may not be lists, or one column may contain errors. Filter out errors first with Table.RemoveRowsWithErrors.

Frequently Asked Questions

What does List.Zip actually return?

A list of lists. Each inner list contains the items from the same position across all input lists, in the order you passed them.

Can List.Zip combine more than two lists?

Yes. Pass any number of lists inside the outer list, for example List.Zip({List1, List2, List3}). The output inner lists will have three items each.

Does List.Zip match items by value?

No. It pairs strictly by position. For value-based matching, use a merge or Table.NestedJoin.

What happens if my lists are different lengths?

The shorter lists are padded with null so every inner list has the same length as the longest input list.

Can I use List.Zip on table columns?

Yes, because a table column is a list. Reference it as TableName[ColumnName]. Both columns must be lists of compatible length.

Is List.Zip available in both Excel and Power BI?

Yes. It is part of the Power Query M formula language used by both Excel and Power BI Desktop.