Forum Discussion

johnelliott's avatar
johnelliott
Frequent Visitor
2 years ago
Solved

Unable to create the relationship I need. Looking for alternative

Greetings experts.

 

I have a table that contains, among other things, the following.

 

Employee name| Employee Email| Employee ID| Manager name|Manager id

 

I am unable to get the manager email from the data source.

The manager is also included in the list of employees

 

I am trying to create a visual table that includes the employee name/email AND the Manager Name/Email

My thought is to relate Manager Name to the the same name in Employee Name and return the associate email.

For example:

 

Table data:

John Doe | [email protected] | 01314 | Sue Jones | 12457

Sue Jones | [email protected] |12457 | Bob Adams | 42121

 

Visual

John Done [email protected]  Sue Jones  [email protected] 

 

Thoughts on a way to create this table relationship to itself?

 

Thank you!

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi johnelliott ,

    I don't understand what do you mean by "Thoughts on a way to create this table relationship to itself" ?
    In Power BI, if you only have one table, you can't create a relationship anyway. But I can find a workaround for you.
    Use this DAX to create a new column in your table:

    Manager Email = 
    LOOKUPVALUE(
        'Table'[Employee Email],
        'Table'[Employee name],
        'Table'[Manager name]
    )

    The final output is below:


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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi johnelliott ,

    I don't understand what do you mean by "Thoughts on a way to create this table relationship to itself" ?
    In Power BI, if you only have one table, you can't create a relationship anyway. But I can find a workaround for you.
    Use this DAX to create a new column in your table:

    Manager Email = 
    LOOKUPVALUE(
        'Table'[Employee Email],
        'Table'[Employee name],
        'Table'[Manager name]
    )

    The final output is below:


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