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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
mark_carlisle
Advocate IV
Advocate IV

Lookup a value within a table

I have a table in Power BI which looks similar to below (unable to post the actual table as this contains confidential information). Essentially it collates all of the different logins/user names from all the difference systems used into one table.

 

Employee No.First NameSurnameFull NameManager NameLogin 1Login 2EmailTeamIs ManagerManagerEmail
1

Fahima

MaddoxFahima MaddoxJodi VaughnFahima.Maddox71328Fahima.Maddox@example.comJodi Vaughn - Team 10 
2

Jemima

MatthamsJemima MatthamsJemima MatthamsJemima.Matthams13576Jemima.Matthams@example.comJemima Matthams - Team 21 
3

Shantelle

HopperShantelle HopperJemima MatthamsShantelle.Hopper71313Shantelle.Hopper@example.comJemima Matthams - Team 20 
4

Catherine

MahoneyCatherine MahoneyJodi VaughnCatherine.Mahoney28973Catherine.Mahoney@example.comJodi Vaughn - Team 10 
5

Winston

AguilarWinston AguilarJemima MatthamsWinston.Aguilar26515Winston.Aguilar@example.comJemima Matthams - Team 20 
6

Jodi

VaughnJodi VaughnJodi VaughnJodi.Vaughn57630Jodi.Vaughn@example.comJodi Vaughn - Team 11 

 

What I want to be able to do is to lookup the email address of the employees manager and show it in the ManagerEmail column, as below.

 

Employee No.First NameSurnameFull NameManager NameLogin 1Login 2EmailTeamIs ManagerManagerEmail
1

Fahima

MaddoxFahima MaddoxJodi VaughnFahima.Maddox71328Fahima.Maddox@example.comJodi Vaughn - Team 10Jodi.Vaughn@example.com
2

Jemima

MatthamsJemima MatthamsJemima MatthamsJemima.Matthams13576Jemima.Matthams@example.comJemima Matthams - Team 21Jemima.Matthams@example.com
3

Shantelle

HopperShantelle HopperJemima MatthamsShantelle.Hopper71313Shantelle.Hopper@example.comJemima Matthams - Team 20Jemima.Matthams@example.com
4

Catherine

MahoneyCatherine MahoneyJodi VaughnCatherine.Mahoney28973Catherine.Mahoney@example.comJodi Vaughn - Team 10Jodi.Vaughn@example.com
5

Winston

AguilarWinston AguilarJemima MatthamsWinston.Aguilar26515Winston.Aguilar@example.comJemima Matthams - Team 20Jemima.Matthams@example.com
6

Jodi

VaughnJodi VaughnJodi VaughnJodi.Vaughn57630Jodi.Vaughn@example.comJodi Vaughn - Team 11Jodi.Vaughn@example.com

 

I feel like this should be possible but I just can't think of what I would need to do.

1 ACCEPTED SOLUTION

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

Hi @mark_carlisle

 

Hopefully this would work

 

Column =
VAR mytable =
    SUMMARIZE ( Table1, [Full Name], [Email] )
VAR mymanager = Table1[Manager Name]
RETURN
    LOOKUPVALUE ( [Email], [Full Name], mymanager )

Thanks for this, however I get an error;

 

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

 

TeamManagerEmail = VAR mytable=SUMMARIZE('DV_STAFF2:DV_STAFFBY_EMPNO',[FullName],[SageEmailAddress])
VAR mymanager='DV_STAFF2:DV_STAFFBY_EMPNO'[Team Manager]
RETURN
LOOKUPVALUE([SageEmailAddress],[FullName],mymanager)

The only difference between mine and yours is the '' marks around the table name.

 

Any suggestions?

@mark_carlisle,

 

As mentioned here, 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.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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