Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Power BI Self Join

Hello Team,

 

I want to extract the manager names from the same table.

 

There is the employee table 

Employee idManager ID emp FnameEmp Lname
    

 

All mangerid are in employeeid coloumn but not all employee are managers.

I want to pull the Fname and Lname of the managers by looking up the value in emp id colomn

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    Try to create a calculated table using dax

    Table 2 = SELECTCOLUMNS(FILTER('Table',[Manager ID]<>BLANK()),"Fname",[emp Fname],"Lname",[Emp Lname])

    Check the details from the attachment.

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Are you looking for a DAX solution or trying to do this in the query editor?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Try to create a calculated table using dax

    Table 2 = SELECTCOLUMNS(FILTER('Table',[Manager ID]<>BLANK()),"Fname",[emp Fname],"Lname",[Emp Lname])

    Check the details from the attachment.

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hi,

    Where do you want the extraction to happen - a new table or a visual.  Should it be a calculated column or a measure?  Care to share more details????