List.Combine Function (Power Query M)

If you have several separate lists and you want to merge them into one single list, the List.Combine function is what you’re looking for.

In this article, I’ll show you how to use List.Combine in Power Query to join lists end to end, with a few practical examples.

Syntax of List.Combine Function

List.Combine(lists as list) as list

where

  • lists (required, list). A list of lists. Each item inside it is itself a list, and List.Combine joins all of those inner lists together into one.

Returns: a single list that contains every item from each inner list, in the order they appear. An empty inner list adds nothing to the result.

In plain terms, you hand it a bunch of lists wrapped in one outer list, and it gives you back one flat list with all their items in it. It is one of the handy list functions you pick up as you start working with Power Query.

Example 1: Combine two number lists

Join two small lists of numbers into one.

let
Source = List.Combine({{10,20},{30,40}})
in
Source

Result: {10, 20, 30, 40}

The two inner lists are joined in order, so {10,20} comes first and {30,40} follows.

Example 2: Combine three text lists

You can pass as many inner lists as you like, and they can be different lengths.

let
Source = List.Combine({{"red","green"},{"blue","yellow"},{"black"}})
in
Source

Result: {"red", "green", "blue", "yellow", "black"}

All three lists are merged top to bottom, and the single-item last list {"black"} just adds its one value at the end.

Example 3: Combine a column from two tables

This is where List.Combine earns its keep. Say you have two tables of sales reps, one per quarter, and you want a single list of every rep. If you instead need to join tables on a matching column, you would merge queries in Power Query rather than combine lists.

Here is the first quarter’s data:

Rep
Alice
Brian
Chloe

And the second quarter’s data:

Rep
Diana
Ethan

Pull the Rep column from each table and combine the two lists.

let
Q1 = Excel.CurrentWorkbook(){[Name="Q1Reps"]}[Content],
Q2 = Excel.CurrentWorkbook(){[Name="Q2Reps"]}[Content],
Source = List.Combine({Q1[Rep],Q2[Rep]})
in
Source

Q1[Rep] and Q2[Rep] each return a list of names, and List.Combine joins them into one.

Result: {"Alice", "Brian", "Chloe", "Diana", "Ethan"}

Example 4: Combine, then remove duplicates

List.Combine keeps every value, including repeats. To get a clean unique list, wrap it in List.Distinct.

Say you have a table of tags pulled from your posts, and some tags repeat.

TagList
excel
formulas
excel
charts
formulas

You want to add two more tags and end up with a clean list that has no repeats.

let
Source = Excel.CurrentWorkbook(){[Name="PostTags"]}[Content],
AllTags = List.Combine({Source[TagList],{"powerquery","excel"}}),
Unique = List.Distinct(AllTags)
in
Unique

List.Combine merges the table’s tags with the extra two, then List.Distinct drops the repeats.

Result: {"excel", "formulas", "charts", "powerquery"}

Example 5: Empty inner lists add nothing

If one of the inner lists is empty, List.Combine simply skips over it.

let
Source = List.Combine({{1,2},{},{3,4},{}})
in
Source

Result: {1, 2, 3, 4}

The two empty lists {} contribute no items, so the result is just the values from the non-empty lists.

Things to keep in mind with List.Combine

  • It flattens exactly one level, not deeply. List.Combine only merges the inner lists you pass it. If an inner list itself contains another list, that nested list stays nested. For example, List.Combine({{1,2},{3,{4,5}}}) returns {1,2,3,{4,5}}, where {4,5} is left untouched as a nested list.
  • The argument must be a list of lists. Passing a flat list of plain values throws Expression.Error: We cannot convert a value of type ... to type List. Make sure every item in the outer list is itself a list.
  • Use List.Union instead when you want automatic deduplication. List.Union merges lists and removes duplicates in one step, while List.Combine keeps everything. For combining tables rather than lists, Table.Combine is the table-level equivalent.
  • It joins lists, not text. To merge text values into one string with a separator, you concatenate in Power Query instead. List.Combine keeps each value as a separate list item.

Common questions about List.Combine

What is the difference between List.Combine and List.Union?

List.Combine joins the lists and keeps every value, including duplicates. List.Union joins them but removes duplicates automatically, keeping the first occurrence of each value.

How do I remove duplicates after combining lists?

Wrap the result in List.Distinct, like List.Distinct(List.Combine({...})). Example 4 shows this in action.

Does List.Combine flatten deeply nested lists?

No. It flattens only one level. Any list nested inside an inner list stays nested in the result, so {4,5} inside an inner list comes back as {4,5}, not as separate items.

List of All Power Query Functions

Related Power Query Functions / Articles:

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.