Forum Discussion

cherry_b's avatar
cherry_b
New Member
9 years ago
Solved

contains statement

 I have a simple statement tha tI need to implement, but it seems so difficult.

All I need is a calculated column based on an existing column

ne column = if 'existing column A' like '%good%' then 'Y' else 'N' end

 

 

  • sokg's avatar
    sokg
    9 years ago

    Hi cherry_b

     

    Please try this

     

    yes or no = IF(IFERROR(SEARCH("*good*";Table1[test]);-1)=1;"Y";"N")

     

    Note this:   The search function is case insensitive

     

    Tell me if this is ok for you.

     

  • cherry_b

     

    HI, you can do this in Query Editor: (Add Column - Conditional Column)

     

     

    Or if you need in DAX:

     

    Column = IF(SEARCH("Good",Table1[Status],,0)>0,"Y","N")

     

     Regards

     

    Victor

    Lima - Peru

3 Replies

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    cherry_b

     

    HI, you can do this in Query Editor: (Add Column - Conditional Column)

     

     

    Or if you need in DAX:

     

    Column = IF(SEARCH("Good",Table1[Status],,0)>0,"Y","N")

     

     Regards

     

    Victor

    Lima - Peru

  •  I have a simple statement tha tI need to implement, but it seems so difficult.

    All I need is a calculated column based on an existing column

    ne column = if 'existing column A' like '%good%' then 'Y' else 'N' end

     

     

    • sokg's avatar
      sokg
      Solution Supplier

      Hi cherry_b

       

      Please try this

       

      yes or no = IF(IFERROR(SEARCH("*good*";Table1[test]);-1)=1;"Y";"N")

       

      Note this:   The search function is case insensitive

       

      Tell me if this is ok for you.