web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Custom column using VL...
Power Apps
Answered

Custom column using VLookup?

(0) ShareShare
ReportReport
Posted on by

Hello all!

I have been struggling with this for a while, I hope someone can help out.
I have a situation where I have a Power Query / dataset 'dataSet', that can be refreshed with monthly new data. Part of this data set is:

 

Ref numberOwner

100

Jane
101Peter
102Frank
103Jane
104Frank
105Frank

 

Then inside a separate worksheet, I have manually entered the following 'static' additional information:

 

NameDepartment
FrankFinance
JaneSales
PeterFinance

 

I would love for a Power Query method to add a custom column in the existing query, that looks at the name and fills the custom column with the corresponding department. It should then look something like this:

 

Ref numberOwnerDepartment

100

JaneSales
101PeterFinance
102FrankFinance
103JaneSales
104FrankFinance
105FrankFinance

 

In normal excel terms I'd use VLookup. Could anyone help me how to do this using M formula language?

 

Many thanks in advance!

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Hi Syndicate,

    Thanks, I've tried it but it didn't quite work yet. I filled in what I believe is the table names, which I made as connection only queries:
    NewStep = Table.AddColumn(#"Replaced Value","Department",each #"Name vs Dept"{[Unique names=[Unique names]]}?[Department]?)

    "'Replaced Value" = the query where the new column should come with the data present of the first table in my original post

    "Name vs Dept" = the connection query containing the columns "Unique names" and "Department".

     

    Is it right to make this table I have on the different worksheet into a query in order to use it?

    Thanks again!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard