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
jmg80525
Helper I
Helper I

Filter for rows containing (or not) letters in the values

Seems simple, but I'm stumed.  Want to filter for rows that where a letter is present in the cell value.  SQL would be  '[A-Z]. Seems like it would be a common question, but I can't find a solutuion. TIA.

1 ACCEPTED SOLUTION
v-xjiin-msft
Solution Sage
Solution Sage

Hi @jmg80525,

 

In your scenario, you want to filter the rows which are containing letters. Right?

 

First you should know there's no such function like SQL which can be used to find the letters directly. Then to achieve this, we need to create a table for all the letters manually. Please refer to my sample, I only put in 3 letters in the letter for test.

 

111.PNG

 

Next create a new calculated column in source table with expression like below.

 

Column 2 =
SUMX ( Letter, IF ( FIND ( Letter[Col], Table2[Val],, 0 ) >= 1, 1, 0 ) )

It means when source table (Table2) exists letters in Letter table, the IF(Find()) returns 1 else 0. Then Sum all the values. It also means, when the expression returns number which is bigger than 0, the row is contaning letters in Letter table. 

 

222.PNG

 

Thanks,
Xi Jin.

 

View solution in original post

1 REPLY 1
v-xjiin-msft
Solution Sage
Solution Sage

Hi @jmg80525,

 

In your scenario, you want to filter the rows which are containing letters. Right?

 

First you should know there's no such function like SQL which can be used to find the letters directly. Then to achieve this, we need to create a table for all the letters manually. Please refer to my sample, I only put in 3 letters in the letter for test.

 

111.PNG

 

Next create a new calculated column in source table with expression like below.

 

Column 2 =
SUMX ( Letter, IF ( FIND ( Letter[Col], Table2[Val],, 0 ) >= 1, 1, 0 ) )

It means when source table (Table2) exists letters in Letter table, the IF(Find()) returns 1 else 0. Then Sum all the values. It also means, when the expression returns number which is bigger than 0, the row is contaning letters in Letter table. 

 

222.PNG

 

Thanks,
Xi Jin.

 

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.