# Power Query, if(AND) equivalent?



## cr731 (Jan 22, 2016)

I'm trying to add a custom column in Power Query that tests two columns values at once.  In Excel terms, something like,

IF(AND(Criteria1,Criteria2),true,false)

Can this be done in Power Query?


----------



## Matt Allington (Jan 22, 2016)

I am not aware of an AND option.  You can nest 2 if statements....

if x then (if y then "both match" else "both don't match") else "both don't match

or assuming you are checking 2 columns, you could create a new concatenated column and test for the concatenated pair you are after


----------



## ImkeF (Jan 23, 2016)

you could also write it like this:

if Citeria1 and Criteriae then true else false

I prefer to use brackets in these cases:

if (Criteria1 and Criteria2) then true else false


----------

