Forum Discussion
Ekaterina
9 years agoRegular Visitor
IF condition
Hello, could anyone tell me what is wrong with the following statement: Column = IF Query[CR] = NaN then 0 else Query1[CR] Thank you, Ekaterina
MarcelBeug
9 years agoCommunity Champion
= NaN won't work either in Power Query.
Working example query:
let
Source = Table.FromList({1,#nan,2}, Splitter.SplitByNothing(), {"CR"}, null, ExtraValues.Error),
#"Added Custom" = Table.AddColumn(Source, "Custom", each if Number.IsNaN([CR]) then 0 else [CR])
in
#"Added Custom"