Forum Discussion

timoneill84's avatar
timoneill84
Frequent Visitor
8 years ago

dax formula help

Hi all

 

I'm just trying to modify a DAX formula which currently reads:-

 

check = IF(ISERROR(SEARCH("4x4",Claims[Vehicle Type])),1,0)

 

How do I get it to search for multiple text criteria instead of just 4x4? so say search for "4x4" OR "apples" and return 0 next to those rows?

 

Thanks

1 Reply

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi timoneill84

     

    From the syntax of Search dax, SEARCH(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]]) , there is only one find_text. So you may not search for multiple text by Search dax expression.

     

    You could try to use the formula below to get your expected output.

     

    check_ = if(SEARCH("apple",'Table1'[Type],,0)>0,0,IF(SEARCH("4*4",'Table1'[Type],,0)>0,0,1))

    The output is below.

     

     

     

     

    If you need additional help please share some data sample and expected output.

     

    Best Regards,

    Cherry