Forum Discussion
kkarol
1 year agoFrequent Visitor
two different data types in one if
Hi I have two columns one numeric [number] and one text [name] and i want to make an if statement with them each if ([name] = "AANNAA") and ([number]> 140) then "Yes" else "No" it does not work, i...
- 1 year ago
it works
let my_table = #table(type table [name = text, number = number], {{"BBB", 150}, {"AANNAA", 145}, {"AANNAA", 135}}), it_works = Table.AddColumn(my_table, "if_statement", each if ([name] = "AANNAA") and ([number]> 140) then "Yes" else "No") in it_works - 1 year ago
The if statement you show is fine.
What is the error you get and in what context do you use the if?Please share your code and a screenshot of the error message.
My guess: The if returns a text, but the destination of that result does not accept text...
kkarol
1 year agoFrequent Visitor
PwerQueryKees AlienSx so i guess that is not a problem. i will investigate it and come back to You. Thanks for Your replies.