Understand Text Functions in Power Query M Language, crucial for creating and manipulating textual data. This page provides a comprehensive list and descriptions of Text Functions available in the M Language.
Table of contents
Conversion and Creation Functions
Function Description Input Output Character.FromNumber Converts the number to its character value. Number Text Character.ToNumber Converts a character to its number value. Text Number Guid.From Returns a guid value from the given value. Text Text Text.From Creates a text value from the given value. Any Text Text.FromBinary Decodes data from a binary form into text. Binary Text Text.NewGuid Returns a new, random globally unique identifier (GUID). Text Text Text.ToBinary Encodes text into a binary form. Text Binary Text.ToList Returns a list of character values from the given text value. Text List
Extraction and Position Functions
Function Description Input Output Text.AfterDelimiter Returns the portion of text
after the specified delimiter
Text Any Text.At Returns the character at the specified position. Text Text Text.BeforeDelimiter Returns the portion of text
before the specified delimiter
Text Any Text.BetweenDelimiters Returns the portion of text
between the specified startDelimiter
and endDelimiter
Text Any Text.End Returns the last characters of the text. Text Text Text.Middle Returns the substring up to a specific length. Text Text Text.PositionOf Returns the first position of the value (-1 if not found). Text Any Text.PositionOfAny Returns the first position in the text value of any listed character (-1 if not found). Text Any Text.Range Returns the substring found at offset. Text Text Text.Select Selects all occurrences of the given character or list of characters from the input text value. Text Text Text.Start Returns the start of the text. Text Text Text.TrimEnd Removes all trailing whitespace. Text Text Text.TrimStart Removes all leading whitespace. Text Text
Function Description Input Output Text.Clean Returns the text value with all control characters removed. Text Text Text.Format Returns formatted text from a format string and arguments. Text Text Text.Lower Converts all characters to lowercase. Text Text Text.Proper Capitalizes the first letter of each word. Text Text Text.Trim Removes all leading and trailing whitespace. Text Text Text.Upper Converts all characters to uppercase. Text Text
Function Description Input Output Text.Contains Returns whether the text contains the substring. Text Logical Text.EndsWith Indicates whether the text ends in the specified value. Text Logical Text.InferNumberType Infers the granular number type (Int64.Type, Double.Type, and so on) of a number encoded in text. Text Type Text.Length Returns the number of characters. Text Number Text.StartsWith Indicates whether the text starts with a specified value. Text Logical
Function Description Input Output Text.Combine Concatenates a list of text values into one text value. List Text Text.Insert Inserts one text value into another at a given position. Text Text Text.PadEnd Returns text of a specified length by padding the end of the given text. Text Text Text.PadStart Returns text of a specified length by padding the start of the given text. Text Text Text.Remove Removes all occurrences of the given character or list of characters from the input text value. Text Text Text.RemoveRange Removes a count of characters starting at the given offset Text Text Text.Repeat Returns a text value composed of the input text repeated a specified number of times. Text Text Text.Replace Replaces all occurrences of the given substring in the text. Text Text Text.ReplaceRange Removes a range of characters and inserts a new value at a specified position. Text Text Text.Reverse Reverses the provided text
Text Text Text.Split Splits text into a list of text values based upon a specified delimiter. Text List Text.SplitAny Returns a list of text values, split on any of the characters in the delimiter. Text List