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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
QWERTYZ
New Member

How to filter by exact string

Hello,

 

I want to count the number of rows in a column that contain the string "rds" . Am using the Filters on this page and selected "Contains: RDS" and a card that shows the count result

QWERTYZ_0-1682060334955.png

But it also retrieves the data if the text contains "Regards" or any other word that has rds in it. Tried adding a space before but that would exclude the cases where the text starts with rds.

 

Any idea would be helpful 

 

Thanks !

1 ACCEPTED SOLUTION

Hi @QWERTYZ .

Try this formula :

CountRds = CALCULATE(COUNTROWS('Table'),find("rds ",'Table'[TEST],1,0)>0 || LEFT('Table'[TEST],3)= "rds" || find(" rds",'Table'[TEST],1,0)>0 )
Ritaf1983_0-1682432218967.png

If this post helps, please Accept it as Solution to help other members find it.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @QWERTYZ 

 

You can create a measure to count the rows. 

Measure = COUNTROWS(FILTER('Table (2)', CONTAINSSTRING('Table (2)'[Column]," rds") || LEFT('Table (2)'[Column],3)="rds"))

But this measure doesn't exclude words like "rdse". 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

Ritaf1983
Super User
Super User

Hi @QWERTYZ 

I'm not quite sure what you're trying to accomplish.

Could you please attach a sample of the data?
It would be helpful if you could specify exactly what you want the lines to count.
You say you want to count everything containing RDS, but you also say some words should be excluded.
The logic behind what is required is unclear to me.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi,

 

For example I have these rows:

 

#  Field1

1  I will talk to him. Best regards

2  will go and play billiards

3  having issues with rds

rds has been removed

 

Want to filter only the rows that contain "rds" so it should match only rows 3 & 4. Not 1 & 2 (Regards, billiards). It is a stand alone word.

 

So I can either display only the rows I need or add a card that counts occurances.

 

Sorry if I was not clear enough

Hi @QWERTYZ .

Try this formula :

CountRds = CALCULATE(COUNTROWS('Table'),find("rds ",'Table'[TEST],1,0)>0 || LEFT('Table'[TEST],3)= "rds" || find(" rds",'Table'[TEST],1,0)>0 )
Ritaf1983_0-1682432218967.png

If this post helps, please Accept it as Solution to help other members find it.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors