"IsNot" or "IsNotNull" Formulas

dburke

New member
Joined
Apr 1, 2016
Messages
25
Reaction score
0
Points
0
Friends,

Is it possible to write a Power Query formula that tests if a cell value is not equal to some value?

Example: Creating a new "Transport" column whose value depends on "Animal" column:

Transport: if [Animal] isnot = "Duck" then "Run" else "Flight"
Animal Feet Transport
Duck 2 Flight
Cat 4 Run
Spider 6 Run

I know how to write a 'positive' formula (ie: if [Animal] = "Duck" then "Flight" else "Run"). I have a more complex situation where I need to test based on the 'negative' (isnot).

Related question: can I test if a text cell is not null? ex: if [ColumnA] isnotnull then "A" else "B".

Any help is appreciated.
 
How about this:

if [Animal] <> "Duck" then "Run" else "Flight"

And

if [ColumnA] <> null then "A" else "B"

Which would be equivalent to:

if [ColumnA] = null then "B" else "A"
 
Thank you, Ken.

Your suggestions work very well and make me a much more efficient Power Query user.
 
Back
Top