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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

lookupValue in the same table

Hi All,

 

I am trying to populate a column (Manager ID) using the Lookupvalue but getting error mesage that says "A table of multiple values was supplied where a single value was expected."...following is the DAX I used - 

 

Manager ID = LOOKUPVALUE(OrgChart_Raw[Employee ID Text],OrgChart_Raw[Manager Name],OrgChart_Raw[Employee Name])
 
My table name is OrgChart_Raw. I am trying to populate the Manager ID Column from Employee IDText Column where all the managers' name is also in the employee Name column. I can do this very easily in Excel using Vlookup function but was wondering whther I can do it in Power BI as well.
LookupValue.jpg

Appreciate any help

1 ACCEPTED SOLUTION
mauriciosotero
Resolver III
Resolver III

Hi,

 

You can use this DAX:

 

Manager ID = LOOKUPVALUE('OrgChart_Raw'[Employee ID],'OrgChart_Raw'[Name],'OrgChart_Raw'[Manager Name])

Capture2.PNG

 

If this helps, I apreciate you give a kudo and mark as the solution. Thanks

View solution in original post

5 REPLIES 5
mauriciosotero
Resolver III
Resolver III

Hi,

 

You can use this DAX:

 

Manager ID = LOOKUPVALUE('OrgChart_Raw'[Employee ID],'OrgChart_Raw'[Name],'OrgChart_Raw'[Manager Name])

Capture2.PNG

 

If this helps, I apreciate you give a kudo and mark as the solution. Thanks

Hi, I have a similar problem.
I have empty rows in the "Manager Name" search column and need to find values only for those rows for which there is a name. I can't solve the problem in any way, but I get a notification: A table with more values is given when an individual value was expected.

ChrisMendoza
Resident Rockstar
Resident Rockstar

@Anonymous -

 


@Anonymous wrote:

 

... says "A table of multiple values was supplied where a single value was expected."...

 


From https://dax.guide/lookupvalue/If multiple rows match the search values and in all cases Result_Column values are identical then that value is returned. However, if Result_Column returns different values an error is returned.

 

If you are able to create your table with that constraint LOOKUPVALUE works fine within the same table.

6.png

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



ChrisMendoza
Resident Rockstar
Resident Rockstar

@Anonymous -

Is [Manager Name] ever going to be equal to [Employee Name]? I would take a look at https://www.daxpatterns.com/parent-child-hierarchies/ to handle something like this.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

Hi @ChrisMendoza , yes in the employee column I have all the employees in the organization including the manager, I just want to create a Manager ID column beside manager name column, and all the IDs are in the Employee ID column. I can do it in excel using the vlookup function but wanted to see if this can be done in Power BI.

 

Thanks 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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