Forum Discussion

johunt's avatar
johunt
New Member
9 years ago
Solved

Error in FIND/SEARCH function

I keep getting the following error

The search Text provided to function 'SEARCH' could not be found in the given text.

 

when i put in this formula

UK Region = IF(ISNUMBER(SEARCH("region",Table1[Region ])),"UK" , "International")

 

I tried the formula in excel and it worked.  Any ideas why it doesn't work in PowerBI?  I also tried adding in the extra part of the SEARCH formula with a ,,0) at the end, but that just overrided the IF function and ended up labelling everything UK whether or not the word Region was in the Region column.   I also tried changing the " for ' and the , for ; but it liked that even less. 

 

Any suggestions as to how to correct the formula would be greatly received.

 

 

  • johunt

     

    Hi, Try with this:

     

    UK Region = IF(ISNUMBER(SEARCH("Region",Table1[Region],,BLANK())),"UK","International")

     

    Regards

     

    Victor

    Lima - Peru

6 Replies

  • Can you change your formula to IF(ISTEXT(SEARCH.........)

    • johunt's avatar
      johunt
      New Member

      UK Region = IF(ISTEXT(SEARCH("Region",Table1[Region ])),"UK", "International")

       

      The search Text provided to function 'SEARCH' could not be found in the given text.

       

      Hi there

      Changed it, but still the same error... pic attached ...

       

       

       

      • Vvelarde's avatar
        Vvelarde
        Community Champion

        johunt

         

        Hi, Try with this:

         

        UK Region = IF(ISNUMBER(SEARCH("Region",Table1[Region],,BLANK())),"UK","International")

         

        Regards

         

        Victor

        Lima - Peru