<!-- https://learnsql.cpetoday.com/functions/m/list-combine -->
# List.Combine

Language: Power Query M
Category: List: transform and filter
Syntax: List.Combine(lists, optional combiner)
Summary: Joins a list of lists into one list, end to end.
Returns: A single list with the items of every inner list, in order.
Level: Intermediate
Related: List.Zip, List.Union, List.Transform, List.Sum, Table.Combine

## What it does
List.Combine takes a list whose items are themselves lists and joins them into one long list. It is the list version of stacking tables on top of each other. Use it when you have collected the same kind of values from several places, such as one list of amounts per bank account, and want one total.

## Syntax and arguments
- `lists`: a list of lists, for example `{ {1, 2}, {3}, {4, 5} }`.
- `combiner` (optional): a function that decides how to join the inner lists. If you leave it out, they are joined end to end.

## Example
Three bank accounts each produce a list of cleared amounts for the day. The cash team wants one list to total.

```powerquery
let
    Operating = {1200, -350},
    Payroll = {-8000},
    Savings = {500, 250},
    AllMovements = List.Combine({Operating, Payroll, Savings}),
    NetCash = List.Sum(AllMovements)
in
    NetCash
```

`AllMovements` is {1200, -350, -8000, 500, 250}, and `NetCash` is the sum of those five items. If you want totals by account, keep the lists separate and sum each one.

## Example: a second, different use
Joining two lists with `&` is the same idea for two lists: `{1, 2} & {3, 4}` gives {1, 2, 3, 4}.

## Things to watch
- Every inner item must be a list. A single number in the outer list is an error.
- The result has no record of which list each item came from. Add a label before combining if you need to know, for example by keeping a table with one row per account.
- For tables, use Table.Combine. It stacks tables with matching column names.
- Large numbers of joins are slow. Combine tables rather than lists when you work on rows.

## In business terms
Combining monthly files, daily bank feeds, multiple sub-ledgers or several bank accounts into one control total is routine. Keep the inputs labeled so the combined figure can be traced back to its source.
