Forum Discussion

villa1980's avatar
villa1980
Resolver II
2 years ago
Solved

Custom Column in Power Query Editor Nested Statement

Hi all,

 

 I am trying to create a custom column with a nested if statment. I can do the basics however I want to say
if Example = "Yes" and Example 2 not in ("A","B","C") then "Good" else "Bad2

I am struggling with the not in part of the statement.

 Any help would be much appreciated.

 

Many Thanks

 Alex

  • MFelix's avatar
    MFelix
    2 years ago

    Glad it helped.

     

    Don't forget to accept as the solution so that it can help others.

3 Replies

  • Hi villa1980 ,

     

    For this you must use not  and List contains:

    if [Example] = "Yes" and not( List.Contains ({"A", "B", "C"}, [Example2])) then "Good" else "Bad"

     

     

     

     

     

    • villa1980's avatar
      villa1980
      Resolver II

      That is brilliant, thank-you so much for your help, this has worked a treat.

      • MFelix's avatar
        MFelix
        Super User

        Glad it helped.

         

        Don't forget to accept as the solution so that it can help others.