Text.AfterDelimiter
Text function · By Tahir Nas · Examples run in our simulator · Published · Updated
Returns the text after a delimiter.
When to use it
Use it to take the part after a separator: a domain from an email, an extension from a file name, a suffix after a code. Combine with Text.BeforeDelimiter for the part between two separators.
Syntax
Text.AfterDelimiter(text as nullable text, delimiter as text, optional index as any) as anyParameters
- index
- Which occurrence to use.
Returns
The text after the delimiter.
Example
Text.AfterDelimiter("ana.silva@firm.example", "@")Result
firm.example
Example: after the last dot
Taking the part after the last dot gives a file extension even when the name contains dots.
Text.AfterDelimiter("report.v2.final.xlsx", ".", {0, RelativePosition.FromEnd})Result
xlsx
Both results are produced by the Power Query Exercises simulator, an independent implementation of a documented subset of M, and checked on every build.
Good to know
- Works for any length, unlike fixed-position extraction.
Common mistakes
- Expecting null when the delimiter is missing: the result is empty text.
- Using the first occurrence when the last is wanted.
The matching command in Excel
- Excel for Windows
- Add Column > Extract > Text After Delimiter
- What you see
- A new column holds the text after the delimiter you enter; the original stays.
Paths are for the Power Query editor in Excel for Microsoft 365, checked against Microsoft's documentation on 8 November 2026: Add a column based on a data type (Power Query) (Microsoft Support).
Exercises that use Text.AfterDelimiter
- beginner~6 minPro
Split email addresses into user and domain (logistics)
Add the part before @ as User and the part after @ as Domain.
- intermediate~6 minPro
Build fixed-width badge numbers (logistics)
Turn employee IDs like E104 into badge numbers like BADGE-000104.
- advanced~11 minPro
Append every monthly table in a workbook (kite shop)
A workbook has one Excel table per month (Sales_Jan, Sales_Feb…) plus a notes sheet and a targets table. Append just the monthly sales tables.
Learn more
- Split columns and extract text by delimiter lesson
- Power Query text functions cheat sheet (tested) guide
- Split column recipes: names, codes, addresses and lists guide
Related functions
Official documentation: Text.AfterDelimiter on Microsoft Learn.