Power BI: count number of characters/letters/words using a column

This is how I count the number of characters, letters and/or words using a column.

power bi

Let´s start by the easier ones which are characters and words. Just click on “new column” and put this formula for characters:

LEN([argument])

power bi

And for words, do the same thing and put this formula:


var wcount = LEN('table'[argument])
var commt = SUBSTITUTE('table'[argument]," ","")
return
(wcount - len(commt))+1
power bi

Now for counting only letters without digit, click on “home -> transform data -> transform data”:

power bi

Then on “add column -> custom column”:

power bi

Put this formula:

Text.Length(Text.Select([argument], {"a".."z"}))

power bi

Interesting Topics