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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filter Data based on values starting with certain string

Hi! I want to ask if there is a way for me to filter the table below using DAX based on the Client IP address like the SQL query below:

 

select * from table 

where Client IP like '%127%';

 

 

TechNewbie1_0-1597924381215.png

 

Thank you!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable
5 REPLIES 5
Anonymous
Not applicable

amitchandak
Super User
Super User

@Anonymous , add a measure like this with other not summarized data

calculate(countrows(Table),containsstring(Table[Client IP],"127"))

 

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

 

other option

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

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks, @amitchandak! Is there a way to just filter it? So it will still return other columns like email, browser, etc.

 

I tried adding a filter command but this error message showed:

"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

 

Thank you!!

Greg_Deckler
Community Champion
Community Champion

@Anonymous - You can, you would use SEARCH or FIND

 

You might want to create a "selector" like IF(SEARCH(...),1,0)

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler - Thanks! I shall try this solution too.

I just wanted to filter those %% items and reflect the columns to my table.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.