Downloads
Power Query MList: transform and filterIntermediate

List.Zip

Pairs up items from several lists by position, so the first items go together, then the second items, and so on.

Syntax
List.Zip(lists)

Returns: A list of lists, one inner list per position.

What it does

List.Zip takes several lists of the same length and builds rows out of them: the first item of each list forms the first row, the second items form the second row, and so on. It is the list version of placing two columns side by side. Use it when you have labels in one list and amounts in another and want them paired.

Syntax and arguments

Example

A budget owner has the twelve month names in one list and the budgeted amounts in another. The report needs each month next to its amount.

let
    Months = {"Jan", "Feb", "Mar"},
    Budget = {12000, 12500, 11800},
    Pairs = List.Zip({Months, Budget}),
    FirstRow = Pairs{0}
in
    Pairs

Pairs is {{"Jan", 12000}, {"Feb", 12500}, {"Mar", 11800}}. Each inner list is one row. FirstRow would be {"Jan", 12000}, because lists count from zero.

Example: a second, different use

Turning the pairs into a table: Table.FromRows(Pairs, {"Month", "Budget"}) gives a two-column table ready to load.

Things to watch

In business terms

Pairing labels with values from separate exports, lining up budget and actual columns from different files, and building a quick two-column check are the common uses. Always confirm the counts match, because a pairing error does not show up as an error.

Related functions

All Power Query M functions · View as Markdown · M basics