Text Functions Overview

Updated on

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

FunctionDescription
Character.FromNumberConverts the number to its character value.
Character.ToNumberConverts a character to its number value.
Guid.FromReturns a guid value from the given value.
Text.FromCreates a text value from the given value.
Text.FromBinaryDecodes data from a binary form into text.
Text.NewGuidReturns a new, random globally unique identifier (GUID).
Text.ToBinaryEncodes text into a binary form.
Text.ToListReturns a list of character values from the given text value.

Extraction and Position Functions

FunctionDescription
Text.AfterDelimiterReturns the portion of text after the specified delimiter
Text.AtReturns the character at the specified position.
Text.BeforeDelimiterReturns the portion of text before the specified delimiter
Text.BetweenDelimitersReturns the portion of text between the specified startDelimiter and endDelimiter
Text.EndReturns the last characters of the text.
Text.MiddleReturns the substring up to a specific length.
Text.PositionOfReturns the first position of the value (-1 if not found).
Text.PositionOfAnyReturns the first position in the text value of any listed character (-1 if not found).
Text.RangeReturns the substring found at offset.
Text.SelectSelects all occurrences of the given character or list of characters from the input text value.
Text.StartReturns the start of the text.
Text.TrimEndRemoves all trailing whitespace.
Text.TrimStartRemoves all leading whitespace.

Formatting Functions

FunctionDescription
Text.CleanReturns the text value with all control characters removed.
Text.FormatReturns formatted text from a format string and arguments.
Text.LowerConverts all characters to lowercase.
Text.ProperCapitalizes the first letter of each word.
Text.TrimRemoves all leading and trailing whitespace.
Text.UpperConverts all characters to uppercase.

Information Functions

FunctionDescription
Text.ContainsReturns whether the text contains the substring.
Text.EndsWithIndicates whether the text ends in the specified value.
Text.InferNumberTypeInfers the granular number type (Int64.Type, Double.Type, and so on) of a number encoded in text.
Text.LengthReturns the number of characters.
Text.StartsWithIndicates whether the text starts with a specified value.

Transformation Functions

FunctionDescription
Text.CombineConcatenates a list of text values into one text value.
Text.InsertInserts one text value into another at a given position.
Text.PadEndReturns text of a specified length by padding the end of the given text.
Text.PadStartReturns text of a specified length by padding the start of the given text.
Text.RemoveRemoves all occurrences of the given character or list of characters from the input text value.
Text.RemoveRangeRemoves a count of characters starting at the given offset
Text.RepeatReturns a text value composed of the input text repeated a specified number of times.
Text.ReplaceReplaces all occurrences of the given substring in the text.
Text.ReplaceRangeRemoves a range of characters and inserts a new value at a specified position.
Text.ReverseReverses the provided text
Text.SplitSplits text into a list of text values based upon a specified delimiter.
Text.SplitAnyReturns a list of text values, split on any of the characters in the delimiter.

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/text-functions

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy