Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

LIKE function in a measure

How to use a function that does the same thing as, for example, I want to do a calculation where I want only one group of information in a given field to be considered: Global Efficiency = CALCULAT...
  • v-ljerr-msft's avatar
    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