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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

SELECTEDVALUE and LOOKUPVALUE to display the supervisor in one table matching the employee in anothe

Hello,

I am trying to use the below measure to show the supervisor of an employee.  Once the employee is selected, it should show the employee's manager.  It returns a result, but it is incorrect. 

 

IF (
HASONEFILTER ( EMP_LOOKUP[Employee Name and ID] ),
LOOKUPVALUE (
EMP_MGR[Manager Name ID], -- column you want to retrieve
EMP_LOOKUP[MANAGER_EMPLOYEE_ID], -- column to seach in
_Emp_ID) -- value to search for
& " "
&
LOOKUPVALUE (
EMP_MGR[MGR_SUBSIDIARY], -- column you want to retrieve
EMP_LOOKUP[MANAGER_EMPLOYEE_ID], -- column to seach in
_Emp_ID, -- value to search for
"NOT WORKING"
)
1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I created some sample data and get the expected result as yours, you can take a look

This is my test data:

v-robertq-msft_0-1606283515726.png

 

I created a measure [Manager name]:

Manager name =

var _selectedEmployee=SELECTEDVALUE('Table'[Employee Name])

return

CALCULATE(MAX('Table'[Manager]),FILTER('Table',[Employee Name]=_selectedEmployee))

 

Then I created a Slicer(place [Employee name]) and a card chart(place the measure), like this:

v-robertq-msft_1-1606283515735.png

 

And I guess this is what you want.

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I created some sample data and get the expected result as yours, you can take a look

This is my test data:

v-robertq-msft_0-1606283515726.png

 

I created a measure [Manager name]:

Manager name =

var _selectedEmployee=SELECTEDVALUE('Table'[Employee Name])

return

CALCULATE(MAX('Table'[Manager]),FILTER('Table',[Employee Name]=_selectedEmployee))

 

Then I created a Slicer(place [Employee name]) and a card chart(place the measure), like this:

v-robertq-msft_1-1606283515735.png

 

And I guess this is what you want.

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

amitchandak
Super User
Super User

@Anonymous , Difficult to tell without sample data. Explore my video on how to get data from one table to another : https://www.youtube.com/watch?v=czNHt7UXIe8&t=4s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.