LtCmdrData
Board Regular
- Joined
- Jan 24, 2018
- Messages
- 58
- Office Version
- 365
- Platform
- Windows
In Power Query I am trying to check two different zip code columns for certain conditions. I want to check each column to see if they contain one of four zip codes. If either column contains any of the four zip codes, then I want one result but if neither column contains any of the four, I want a different result returned. Here is a sample of the M code I tried:
if [Origin Zip] <> "37167" or [Origin Zip] <> "43228" or [Origin Zip] <> "76118" or [Origin Zip] <> "92518"
and [Dest Zip] <> "37167" or [Dest Zip] <> "43228" or [Dest Zip] <> "76118" or [Dest Zip] <> "92518"
then "DS"
else "RS"
Perhaps I need to go about this a different way but I am stuck, probably because of the two negative conditions. Can anyone please help? Thank you in advance.
if [Origin Zip] <> "37167" or [Origin Zip] <> "43228" or [Origin Zip] <> "76118" or [Origin Zip] <> "92518"
and [Dest Zip] <> "37167" or [Dest Zip] <> "43228" or [Dest Zip] <> "76118" or [Dest Zip] <> "92518"
then "DS"
else "RS"
Perhaps I need to go about this a different way but I am stuck, probably because of the two negative conditions. Can anyone please help? Thank you in advance.