Creating a conditional column and some AND IF logic in Power BI


I’m thinking about creating a new column that would be populated with number based on the contents of several columns. However, I cannot find an option for this in the Add Conditional Column box. I tried using the Advanced Editor but I cannot find the syntax for this scenario. This is what I am trying to do:

If [COUNTRY] equals Kazakhstan AND IF [COMPANY] equals Alltel, then "1" 
Else If [COUNTRY] equals Kazakhstan AND IF [COMPANY] equals VIP, then "2" 

I hope someone can help me on this.


Try this.

if [Country] = “Kazakhstan” and [#"Company "]= “Alltel”
then 1 else if [Country] = “Kazakhstan” and [#"Company "] = “z” then 2
else 0



Another option here could be a simple calculated column. See here to learn more about there.

Thanks to the contributors of this post. Due to the length by which this post has been active, we are tagging it as Solved. For further questions related to this post, please make a new thread.