Forum Discussion
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%';
Thank you!
- Anonymous6 years ago
This Solved my question. Thanks for your help!!
https://stackoverflow.com/questions/38767000/starts-with-in-an-expression-using-dax
5 Replies
- Greg_DecklerCommunity 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
- AnonymousNot 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.
- amitchandakSuper 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
- AnonymousNot 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!!
- AnonymousNot applicable
This Solved my question. Thanks for your help!!
https://stackoverflow.com/questions/38767000/starts-with-in-an-expression-using-dax