Downloads
Power Query MTextIntermediate

Text.Combine

Joins a list of text values into one text value, with a separator between them.

Syntax
Text.Combine(texts as list, optional separator as nullable text) as text

Returns: One text value.

What it does

Text.Combine is the reverse of Text.Split. It takes a list of text values and joins them into one string. Finance teams use it to build a readable list of invoice numbers for a memo or an email, or to rebuild a key from parts.

Syntax and arguments

Example

A collections report needs one cell that lists every open invoice for a customer, so the collector can paste it into a reminder email.

let
    Open = #table(type table [Customer = text, Invoice = text],
        {{"Acme Supply Co", "INV1043"}, {"Acme Supply Co", "INV1044"}, {"Blue Harbor LLC", "INV1051"}}),
    Grouped = Table.Group(Open, {"Customer"}, {
        {"Invoices", each Text.Combine([Invoice], ", "), type text}
    })
in
    Grouped

Acme Supply Co gets "INV1043, INV1044" and Blue Harbor LLC gets "INV1051". Table.Group collects the invoices for each customer into a list, and Text.Combine joins them.

Example: a second, different use

Join the parts of a key, such as a company code, a year and a period, into one text value with a dash between each part.

Things to watch

In business terms

Collections reminders, audit requests and remittance notes often need a list of references in one field. Text.Combine builds that list from the detail rows without someone retyping them.

Related functions

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