Text.Split() & Text.Combine()
Learn how Text.Split breaks a text value into a list by delimiter, how Text.Combine joins one back together, and the mistakes that come from consecutive delimiters and how nulls are skipped.
Text.Split() & Text.Combine()
Text.Split() and Text.Combine() are opposites: one breaks a single text value into a list of pieces, the other joins a list of text values back into one.
Text.Split(text as text, separator as text) as list
Text.Combine(list as list, optional separator as nullable text) as textText.Split(): One Value Into Many
Text.Split("2026-01-15", "-")"2026-01-15" -> {"2026", "01", "15"}This is the function behind Split Column > By Delimiter in the Editor UI, when splitting into a list rather than directly into table columns.
Text.Combine(): Many Values Into One
Text.Combine({"2026", "01", "15"}, "-"){"2026", "01", "15"} -> "2026-01-15"The separator argument is optional — omitting it concatenates with no separator at all, which is rarely what's actually wanted.
Splitting Into Table Columns vs. a List
Text.Split() on its own produces a list, not new table columns. Splitting a table column directly uses Table.SplitColumn(), which wraps the same splitting logic but reshapes the result back into the table:
#"Split Column" = Table.SplitColumn(
Source, "FullDate", Splitter.SplitTextByDelimiter("-"), {"Year", "Month", "Day"}
)Splitter.SplitTextByDelimiter() here is doing conceptually the same job as Text.Split(), just packaged for Table.SplitColumn()'s specific interface rather than called directly.
Common Mistakes
Assuming a Fixed Number of Parts
Text.Split("A-B", "-")
Text.Split("A-B-C-D", "-")"A-B" -> {"A", "B"} (2 parts)
"A-B-C-D" -> {"A", "B", "C", "D"} (4 parts)Text.Split() returns however many parts the delimiter actually produces — a downstream step assuming exactly 2 or 3 elements breaks silently or errors the moment a row has a different number of delimiters than expected. Table.SplitColumn() with a fixed column-name list has the same issue: extra parts get dropped, and missing parts leave null in the unfilled columns.
Consecutive Delimiters Producing Empty Strings
Text.Split("A,,B", ",")"A,,B" -> {"A", "", "B"}A double delimiter (from a source with genuinely missing values in a delimited field) produces an empty string element, not a skipped one — worth accounting for explicitly if blank entries shouldn't just become "" downstream.
Try it live
| Field | Value |
|---|---|
| Text | |
| Separator |
Try typing two separators back to back, or changing how many appear — the item count and the empty-string chips update live instead of just being described.
Expecting null to Error, or to Leave a Gap
Text.Combine({"A", null, "B"}, ", ")This doesn't error: Text.Combine() skips null items, so the result is "A, B". That's usually what you want, but it means the output gives no sign that a value was missing. If a missing value should still take up a slot, replace it first: List.Transform(theList, each _ ?? "") gives "A, , B".
What does error is a non-text item, such as a number: Text.Combine({"A", 1}) fails because 1 isn't text. Convert those with Text.From first. See Expression.Error: We cannot convert a value of type List to type Text for the related list-to-text error.
Forgetting the Separator Is Optional, Not Automatic
Text.Combine({"John", "Doe"})Result: "JohnDoe" <- no space, no separator at allOmitting the second argument doesn't insert a sensible default like a space — it concatenates with nothing between elements.
Next Steps
- M Language
- Table.ReplaceValue()
- Table.SplitColumn() & Table.CombineColumns() — the same split/combine idea applied to whole table columns
- M Function Reference
Text.Trim(), Text.Upper() & Text.Lower()
Learn how Text.Trim, Text.Upper, and Text.Lower clean up text values, why Text.Trim doesn't always catch what looks like whitespace, and when case-insensitive comparison is the better fix than converting case at all.
Text.Start(), Text.End(), Text.Middle() & Text.Length()
Learn how Text.Start, Text.End, and Text.Middle extract a substring by position, why they're zero-indexed, and how Text.Length combines with them for a variable-length extraction.