Forum Discussion
LIKE function in a measure
- 9 years ago
Hi Anonymous,
The LIKE operators in SQL has a similar correspondent function in DAX: the SEARCH function has a slightly different semantic because it returns the position found instead of a True/False value.
For example, consider the following condition in SQL:
Name LIKE '%SQLBI%Methodology%at%work%'
The correspondent syntax in DAX is:
SEARCH( "SQLBI*Methodology*at*work", Table[Name], 1, 0 ) > 0
There are more similar examples here:
https://www.sqlbi.com/articles/from-sql-to-dax-string-comparison/
Regards
Hi Anonymous,
The LIKE operators in SQL has a similar correspondent function in DAX: the SEARCH function has a slightly different semantic because it returns the position found instead of a True/False value.
For example, consider the following condition in SQL:
Name LIKE '%SQLBI%Methodology%at%work%'
The correspondent syntax in DAX is:
SEARCH( "SQLBI*Methodology*at*work", Table[Name], 1, 0 ) > 0
There are more similar examples here:
https://www.sqlbi.com/articles/from-sql-to-dax-string-comparison/
Regards
- labuserMiles6 years agoNew Member
how about what you wanna search is dynamic. just like a search engine you can type anything in the search box(slicer)