cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Invesco
Helper III
Helper III

Count the number of characters in a string Calculated column or Power Query

Hi Experts

 

How would / could you count the number of characters in a string in a column in a table in Power bI

 

Column A                  Result

Apple                       5

Guidelines                10

Oranges                   7

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Invesco ,

 

You could use LEN() function.

https://docs.microsoft.com/en-us/dax/len-function-dax 

If you want to remove space, you could use SUBSTITUTE() function.

https://docs.microsoft.com/en-us/dax/substitute-function-dax 

Column = LEN(SUBSTITUTE('Table'[Column1]," ",""))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

1 REPLY 1
v-jayw-msft
Community Support
Community Support

Hi @Invesco ,

 

You could use LEN() function.

https://docs.microsoft.com/en-us/dax/len-function-dax 

If you want to remove space, you could use SUBSTITUTE() function.

https://docs.microsoft.com/en-us/dax/substitute-function-dax 

Column = LEN(SUBSTITUTE('Table'[Column1]," ",""))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

Check it Out!

Mark your calendars and join us on Thursday, September 29 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors