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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
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.