Text.TrimStart Power Query to remove leading zeros
Text.TrimStart power query function helps us to remove the leading zeros from the given string. It comes under the category of Power query text functions.
Syntax
Text.TrimStart(Given String, characters that you want to trim)
It takes two parameters.
- The First parameter is the given string that is compulsory
- The second parameter is the number of characters that you want to trim, and it is optional
Text.TrimStart power query function Example
Let’s take the following example in which we have some account numbers with leading zeros, and we want to remove them.
We will use the following formula to remove leading zeros from the text.
Text.TrimStart([Account],"0")
As you can see, it took two parameters.
- The first parameter is the name of the column “Account.”
- The second parameter is the character “0” we want to remove.
To learn more, please visit Learn DAX