Text.TrimEnd Function in Power Query

The Text.TrimEnd function returns the text after removing all the trailing whitespaces.

Syntax

Text.TrimEnd(text as nullable text, optional trim as any) as nullable text

Example: Remove all the trailing whitespaces from the end.

Power Query M

let
    Source = Text.TrimEnd(" Ashish   ")
in
    Source 

The output of the above code is " Ashish".