cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mk720x Member
Member

Count the number of vowels in a string

Hi!

I would like to create a column (not power query!) that returns the number of vowels in a string.

Example:
atehikolule

 

returns 6

 

Any help appreciated!!

1 ACCEPTED SOLUTION

Accepted Solutions
djerro123 Senior Member
Senior Member

Re: Count the number of vowels in a string

I created a table with only 1 column of data (Column1) and made a calculated column Count.

image.png

The formula of the Count column is the following:

Count = 
VAR a = SUBSTITUTE('Table (2)'[Column1], "a", "")
VAR e = SUBSTITUTE( a, "e", "")
VAR u = SUBSTITUTE( e,"u", "")
VAR i = SUBSTITUTE( u, "i","")
VAR o = SUBSTITUTE( i,"o", "")
RETURN
LEN('Table (2)'[Column1])-LEN(o)

Note that this is case sensitive, if your original column has capital letters you need to add those to the formula.

View solution in original post

1 REPLY 1
djerro123 Senior Member
Senior Member

Re: Count the number of vowels in a string

I created a table with only 1 column of data (Column1) and made a calculated column Count.

image.png

The formula of the Count column is the following:

Count = 
VAR a = SUBSTITUTE('Table (2)'[Column1], "a", "")
VAR e = SUBSTITUTE( a, "e", "")
VAR u = SUBSTITUTE( e,"u", "")
VAR i = SUBSTITUTE( u, "i","")
VAR o = SUBSTITUTE( i,"o", "")
RETURN
LEN('Table (2)'[Column1])-LEN(o)

Note that this is case sensitive, if your original column has capital letters you need to add those to the formula.

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)