cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Chateaux83 Regular Visitor
Regular Visitor

Query editor add custom column

Hi all,

 

a potentially simple thing Smiley Happy

I have to add an extra column to my table - which is the copy of an existing column in the same table, but I have to change just a few values (actually names) here and there. The 'Create column from examples' seems not to be working since does not get the logic, so I am trying with the customized column. 

 

What I would need is the equivalent of simple "IF" excel formula which would allow me to replace the names I want to.

 

Example: I have a list of countries (column1) and a list of continents (column2).

I have to create a new column which replicates the continents list I have already, but includes another continent ("newcontinent") - which I would refer to some of the countries in the countries list.

 

So in excel woul be something like = IF ('Country'='XX'; "newcontinent"; "Country")

 

Any hint on how to transpose this into the power query editor?

 

Many thanks!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
PradipMCT Regular Visitor
Regular Visitor

Re: Query editor add custom column

Hi @Chateaux83 ,

 

You may go to "Add Column" and select "Conditional Column"

 

Regards,

Pradip Microsoft Certified Trainer

Pradip's YouTube Channel

 

View solution in original post

3 REPLIES 3
PradipMCT Regular Visitor
Regular Visitor

Re: Query editor add custom column

Hi @Chateaux83 ,

 

You may go to "Add Column" and select "Conditional Column"

 

Regards,

Pradip Microsoft Certified Trainer

Pradip's YouTube Channel

 

View solution in original post

Chateaux83 Regular Visitor
Regular Visitor

Re: Query editor add custom column

Thanks, I was looking for the hardest way ignoring the pre-made solution :).

 

 

PradipMCT Regular Visitor
Regular Visitor

Re: Query editor add custom column

Hi @Chateaux83 

 

You can go to "Add column" --> "Custom Column" --> write the fomula --> if [Country name] = "XX" then "New continent" else "Country"

 

Regards,

Pradip Microsoft Certified Trainer

Pradip's YouTube Channel

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)