Introduction
Here in this article you will learn one more feature of Power Query. I will add a new column in my table using this new feature i.e. ‘Add Conditional Column’. In my previous articles ‘Add A Custom Column In Power BI’ and ‘Add A Column from Example In Power QueryEditor’ , I have taught you how to add a ‘Custom Column’ and ‘A column from Example’.
To do so, we have to open Power query editor by clicking on ‘Transform Data’ option at the ‘Home’ page of the Power BI tool. After opening the Power query window click on ‘New resource’ to import file. To check how to import file in power query you can see above mentioned links of articles.
Follow the below simple steps to add a conditional column using this new feature.
Step 1
I have imported a CSV file in power query editor. This CSV file contains the details of credit card like CreditCardID. CardType, CardNumber, ExpMonth etc. See the below image.

In this image you can see that we have a numeric value in ‘ExpMonth’ column. So, I will add a one more column in this table that shows the Value of these months in string.
For example, if ‘ExpMonth’ column is having 11, 8 etc. then the new column will show ‘November’, ‘August’ respectively.
Step 2
Now go to ‘Add column’ tab and click on ‘Conditional Column’. A new ‘Add Conditional Column’ window will be open.
Here in this window you can get the below options,
- New Column Name
Enter the name of the new column in this text box. I will add ‘MonthOfExp’.
- If Condition
Here we will mention the if condition, choose the column name, operator, and value (you can enter default value or or value from any column), then give the output value (you can enter default value or or value from any column).
- There are three dots …(more) option to delete the if condition.
- Add Clause
You can add two or more if conditions here
- Else
Here you can add else condition if required.
Step 3
I am giving the if codition as per my requirement that I have mentioned in step 1. As we have 12 month in a year, I will add 12 clauses of if condition. For Example
Column Name Operator Value OutPut
ExpMonth = 11 November.



Join the conversation! Your thoughts help the community grow.