Forum Discussion
evalromf
Helper I
10 years agoAND IF in conditional column
Hi, I'm trying to create a new column that should be populated with a certain number based on the contents of several other columns. What I'm looking for is something like this: If [COUNT...
rayinOz
Helper III
9 years agoSo, this is what I have and I get an "error" in the new custom column...
if ([Course Name] = "Managing Information" or "Promoting Positive Workplace Behaviour")
and ([#"Organisation / Portfolio"] = "Bio21 Australia Ltd" or "Bio21 Australia Limited"
or "CAVAL" or "Grattan Institute" or "Kendall Hall" or "Melbourne University Publishing Ltd"
or "Nossal Institute Ltd" or "University House" or "Australian National Academy of Music Ltd"
or "Melbourne Theatre Company" or "MU Student Union Ltd") then "Exclude" else "Include"
This the error:
GilbertQ
Super User
9 years agoHave you tried putting the follwing below?
if ([Course Name] = "Managing Information" or [Course Name = "Promoting Positive Workplace Behaviour")
And then repeat for each instance?
- GilbertQ8 years ago
Super User
Hi Anonymous
You can create a new Custom Column in the Power Query Editor with the following syntax
if [col1] = "a1" and [col2] = "a2" then 50 else if [col1] = "b1" and [col2] = "b2" then 100 else if [col1] = "c1" and [col2] = "c2" then 200 else 999
- GilbertQ9 years ago
Super User
Glad you found a solution!
- Anonymous8 years agoNot applicable
What was the response to this.
I have similar situation for a custom column, i need to have values
if col1=a1 and col2 =a2 then '50'
else col1=b1 and col2=b2 then 100
and so on for 20 values
how to resolve this
- rayinOz9 years ago
Helper III
I have not, I'll give that a shot! Thanks!
- rayinOz9 years ago
Helper III
That worked!! Thanks you guys for helping me out!!
- RodrigoTXRA8 years ago
Helper I
Please see content from @gilbertiq, that would suit your needs