Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

undefined

Hi All,

I have two tables, Project table and User table. I have to fetch the name of the project manager using DAX exp.

 

Below is the table structure:

 

Project table

Project_ID    Name           Manager_Id       

1                  Aladeen       10

2                  Pointy           2

 

User table

User_ID       Name 

1                 Boss

2                 Baby

10               Musk

 

 

Now, I have to create to measure/column in the Project table with DAX which gives me the names of users from the second table.

P.S. Both the tables are in direct query mode.

 

Desired output-

Project table

Project_ID    Name           Manager_Id       Project_Manager

1                  Aladeen       10                     Musk

2                  Pointy           2                      Baby

 

How can I achieve this in DAX? Any help is appreciated.

  • Hi, Anonymous 

    Please check the below. It is for creating a new column.

     

     

    Project_Manager CC =
    LOOKUPVALUE(User[Name], User[User_ID],Project[Manager_ID])
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

3 Replies

  • Hi, Anonymous 

    Please check the below. It is for creating a new column.

     

     

    Project_Manager CC =
    LOOKUPVALUE(User[Name], User[User_ID],Project[Manager_ID])
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

  • Create a relationship between the 2 tables (User_Id and Manager_Id)

    Then you can just create a table visualization without any other step.

    If for any reason you need to have the user in the project table, you can create a calculated column:
    'Project table'[Project_Manager] = RELATED ( 'User table'[Name] )