<!-- https://learnsql.cpetoday.com/functions/m/combiner-combinetextbydelimiter -->
# Combiner.CombineTextByDelimiter

Language: Power Query M
Category: Splitters and combiners
Syntax: Combiner.CombineTextByDelimiter(delimiter, optional quoteStyle)
Summary: Returns a combiner that joins several text values into one, with a chosen delimiter between them.
Returns: A function that you pass to a combine step such as Table.CombineColumns, or call on a list. It returns one text value.
Level: Intermediate
Related: Splitter.SplitTextByDelimiter, Table.CombineColumns, Text.Combine, List.Transform, Replacer.ReplaceText

## What it does
A combiner is the opposite of a splitter. Combiner.CombineTextByDelimiter builds a rule that joins text values with a separator between them, such as a comma, a slash or a pipe. Use it to put several columns into one text field for an export, or to build a reference from parts such as entity, year and number.

## Syntax and arguments
- `delimiter`: the text placed between the values, such as `", "`, `"|"` or `"-"`.
- `quoteStyle` (optional): how text that contains the delimiter is quoted. `QuoteStyle.Csv` adds double quotes around values that contain a comma or a quote, which is what a CSV file needs.

## Example
An export needs one reference column built from the entity, the year and the sequence number of each journal, separated by hyphens.

```powerquery
let
    Source = Table.FromRecords({
        [Entity = "NW", Year = "2026", Sequence = "0415"],
        [Entity = "NW", Year = "2026", Sequence = "0416"]
    }),
    Combined = Table.CombineColumns(Source, {"Entity", "Year", "Sequence"},
        Combiner.CombineTextByDelimiter("-", QuoteStyle.None), "JournalRef")
in
    Combined
```

Each row now has a JournalRef such as "NW-2026-0415". The original three columns are removed by Table.CombineColumns, which leaves the new reference column.

## Example: a second, different use
Joining a list of text values into one line for a note: `Combiner.CombineTextByDelimiter(", ")({"Acme", "Bolt"})` returns "Acme, Bolt". For a plain list, Text.Combine does the same job with less setup.

## Things to watch
- A null in one of the columns can leave an empty piece or an extra delimiter. Replace nulls with empty text first.
- Use `QuoteStyle.Csv` when the values may contain the delimiter, so the result can be read back.
- The combined value is text. Numbers that are combined lose their number type.
- The delimiter is placed between values only, not at the start or end.

## In business terms
Building journal references, invoice keys, document numbers and CSV lines for an upload file is a common job. Keeping the reference format in one query means every file uses the same rule.
