Forum Discussion

mark_carlisle's avatar
mark_carlisle
Advocate IV
8 years ago
Solved

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.Maddox71328[email protected]Jodi Vaughn - Team 10 
2

Jemima

MatthamsJemima MatthamsJemima MatthamsJemima.Matthams13576[email protected]Jemima Matthams - Team 21 
3

Shantelle

HopperShantelle HopperJemima MatthamsShantelle.Hopper71313[email protected]Jemima Matthams - Team 20 
4

Catherine

MahoneyCatherine MahoneyJodi VaughnCatherine.Mahoney28973[email protected]Jodi Vaughn - Team 10 
5

Winston

AguilarWinston AguilarJemima MatthamsWinston.Aguilar26515[email protected]Jemima Matthams - Team 20 
6

Jodi

VaughnJodi VaughnJodi VaughnJodi.Vaughn57630[email protected]Jodi 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.Maddox71328[email protected]Jodi Vaughn - Team 10[email protected]
2

Jemima

MatthamsJemima MatthamsJemima MatthamsJemima.Matthams13576[email protected]Jemima Matthams - Team 21[email protected]
3

Shantelle

HopperShantelle HopperJemima MatthamsShantelle.Hopper71313[email protected]Jemima Matthams - Team 20[email protected]
4

Catherine

MahoneyCatherine MahoneyJodi VaughnCatherine.Mahoney28973[email protected]Jodi Vaughn - Team 10[email protected]
5

Winston

AguilarWinston AguilarJemima MatthamsWinston.Aguilar26515[email protected]Jemima Matthams - Team 20[email protected]
6

Jodi

VaughnJodi VaughnJodi VaughnJodi.Vaughn57630[email protected]Jodi Vaughn - Team 11[email protected]

 

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

4 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    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 )
      • mark_carlisle's avatar
        mark_carlisle
        Advocate IV

        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?