cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
im_newbie_123 Frequent Visitor
Frequent Visitor

Power Query for Custom Column

I have three columns Last Name, First Name and Preferred Name. 

Some of the records in these are NULL.

I have to create a custom column called Person Name which will have data like below, based on last name,first name and preferred name.

 

For example : 

Expected Output :

Last name                  First Name                   Preferred Name                    Person Name

Hans                           Samuel                        NULL                                     Hans, Samuel

Alfred                          NULL                           NULL                                     Alfred

Kennedy                     John                            Joe                                         Kennedy, John (Joe)

-----------------------------------------------------------------------------------------------------------------------------

 

My Query :

Ques.PNGMy query

 

This generates values like :

Person Name

NULL

NULL

Kennedy, John (Joe)

1 ACCEPTED SOLUTION

Accepted Solutions
mcybulski Member
Member

Re: Power Query for Custom Column

Try this formula

Text.Combine({[Last Name],[First Name]},", ") &
(if [Preferred Name] = null then "" else " ("&[Preferred Name]&")")

View solution in original post

1 REPLY 1
mcybulski Member
Member

Re: Power Query for Custom Column

Try this formula

Text.Combine({[Last Name],[First Name]},", ") &
(if [Preferred Name] = null then "" else " ("&[Preferred Name]&")")

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Top Kudoed Authors
Users Online
Currently online: 367 members 3,808 guests
Please welcome our newest community members: