Text.PadStart

It will return a text value that has been padded to a specific length by adding spaces at the beginning of the text. You can also specify a different character to use for padding by including the opti...

Syntax

Text.PadStart(text as nullable text, count as number, optional character as nullable text) as nullable text

About

It will return a text value that has been padded to a specific length by adding spaces at the beginning of the text. You can also specify a different character to use for padding by including the optional character parameter. If no character is specified, the default padding character is a space.

Explanation

Example 1 Initiate the process of adding extra characters at the beginning of a text value to ensure it reaches a length of 10 characters. This is achieved by using the Power Query MText.PadStart function with the text value "Name" and the desired length of 10 characters. Output: " Name" Example 2 To add the character "|" at the start of a text value in order to reach a total length of 10 characters, the Power Query MText.PadStart function is used with the parameters "Name", 10, and "|". Output: "||||||Name"