Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
ANG1994
Frequent Visitor

New Columns

ANG1994_0-1685008311646.png

Sorry this may be simple but I am new to Power BI,

Can I create an extra 2 columns where Column 1 is J and Column is 2? 

 

This will be my answer:

(Ignore the 0's before Job)

ANG1994_1-1685008751156.png

 

Thank you for your help 🙂 

1 ACCEPTED SOLUTION
AjithPrasath
Resolver II
Resolver II

Hi @ANG1994 ,

Here are the steps on how to create two new columns in Power BI, one for J and one for P, and copy the job column values with J as the source to the J column and P source to the P column:

  1. Open the Power BI Desktop application.
  2. In the Power Query Editor, select the table that you want to create the new columns in.
  3. In the Home tab, click on the Add Column button.
  4. In the Add Column dialog box, select the Conditional Column option.
  5. In the Column Name field, type in the name of the new J column.
  6. In the Expression field, type in the following formula:

 

IF([Source] = "J", [Job], "")​

 

  • Click on the OK button.
  • Repeat steps 3-7 to create the new P column, but use the following formula in the Expression field:

 

IF([Source] = "P", [Job], "")

 

Click on the Close & Load button.

Best Regards,

Ajith Prasath

If this post helps, then please consider Accept it as the solution and give kudos to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
ANG1994
Frequent Visitor

Thank you it worked fine! 😀

AjithPrasath
Resolver II
Resolver II

Hi @ANG1994 ,

Here are the steps on how to create two new columns in Power BI, one for J and one for P, and copy the job column values with J as the source to the J column and P source to the P column:

  1. Open the Power BI Desktop application.
  2. In the Power Query Editor, select the table that you want to create the new columns in.
  3. In the Home tab, click on the Add Column button.
  4. In the Add Column dialog box, select the Conditional Column option.
  5. In the Column Name field, type in the name of the new J column.
  6. In the Expression field, type in the following formula:

 

IF([Source] = "J", [Job], "")​

 

  • Click on the OK button.
  • Repeat steps 3-7 to create the new P column, but use the following formula in the Expression field:

 

IF([Source] = "P", [Job], "")

 

Click on the Close & Load button.

Best Regards,

Ajith Prasath

If this post helps, then please consider Accept it as the solution and give kudos to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.