Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
samanthabowdell
New Member

Counting number of letters in a string

I am trying to create a conditional column in a report that takes a value from another column and identifies it by the number of text characters in the string. 

Example -

AB1234 = 2 text characters 

Once this has been done I need to allocate a job type based on that number 

Example -

2 = Job 1

I know I can use text.select to extract the text and text.length to count but don't want to create lots of extra column on a already big table.

 

  • It needs to be in the table for the way I am analysing the data.

 

Can anyone help me? 

2 REPLIES 2
pbix1
Resolver I
Resolver I

Hi SamanthaBowdell

 

This will count the number of alpha characters in a string that also contains numbers. Create a custom column and paste in the below:

 

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

 

Column1 is the name of the column you want to obtain the count from. Does this help?

 

Neil

You could then have a separate table with the job numbers and descriptions, and then merge the tables on the job number to get the job description.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors