Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Column ID based on another columns data.

I had 3 columns in a table Employee ID , Employee name & Manager name. I want to create a 4th column name as Managers ID which will come from Employee ID. Any help will be really appreciated.

 

This is what exactly i want :

 

EmployeeID   EmployeeName   Managername   ManagerID  

1                    ABC                      JHU                    4

2                    SDF                      MLP                    5

3                    BKJ                       ABC                    1

4                    JHU                      SDF                     2

5                    MLP                      SDF                    2

  • Hi Anonymous ,

     

    New a calculated column with below DAX formula.

    ManagerID =
    LOOKUPVALUE ( Data_2[EmployeeID], Data_2[EmployeeName], Data_2[Managername] )
    

     

    Best regards,

    Yuliana Gu

1 Reply

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi Anonymous ,

     

    New a calculated column with below DAX formula.

    ManagerID =
    LOOKUPVALUE ( Data_2[EmployeeID], Data_2[EmployeeName], Data_2[Managername] )
    

     

    Best regards,

    Yuliana Gu