Forum Discussion
majdkaid22
Helper V
10 years agocustom column in M query
Hi guys, Am using the below formula to filter a particular column based on the last character in the group name if Text.End( Text.Upper( [Group] ), "S" ) then "A" else "B" it's return...
- 10 years ago
try this:
if Text.End( Text.Upper( [Group] ), 1) = "S"
then "A"
else "B"
ImkeF
Community Champion
10 years agoThis is a syntax-error in the Text.End-formula (second argument need to be the number of letters to be returned - LinkToRessource) as well as in the conditional statment (when you use an if you need to combine it with an operator/comparer - LinkToRessource).
Anonymous
10 years agoNot applicable
Text.End will return the last n characters of a string. You have to tell it how many you want. If you leave off that number it will give you an error because you didn't finish writing the entire formula. Text.End( Text.Upper( [Group] ), 1) returns the last character. Text.End( Text.Upper( [Group] ), 2) would return the last 2 characters, Text.End( Text.Upper( [Group] ), 7) the last 7 characters, etc.