Forum Discussion

quinla01's avatar
quinla01
Advocate I
7 years ago
Solved

Add Column - Map ID to Value

Hi All, 

 

Hoping this is fairly simple. I have single table as shown below (real table has 1000's of rows)

 

 

I'm not interested in "Manager ID". I want manager name as per below. 

 

 

Any suggestions? The logic is something along the lines of

  • Get manager ID from column 3
  • If it's null do nothing. 
  • if it's not null then find ID in column 1 and retrun employee

 

Thanks

 

 

  • hi, quinla01 

    You could use LOOKUPVALUE Function to create a calculate column as below:

    Manager = IF(ISBLANK('Table'[Manager ID])=FALSE(),LOOKUPVALUE('Table'[Employee],'Table'[ID],'Table'[Manager ID]))

    Result:

     

    Best Regards,

    Lin

     

2 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi, quinla01 

    You could use LOOKUPVALUE Function to create a calculate column as below:

    Manager = IF(ISBLANK('Table'[Manager ID])=FALSE(),LOOKUPVALUE('Table'[Employee],'Table'[ID],'Table'[Manager ID]))

    Result:

     

    Best Regards,

    Lin

     

    • quinla01's avatar
      quinla01
      Advocate I

      That worked a charm. Many Thanks. 

       

      Out of interest, do you know how this would be done from the query editor rather than in report view? 

       

      Thanks