Forum Discussion

StarLord42's avatar
StarLord42
New Member
3 years ago
Solved

Two connections between two tables

Hi,

I am new to Power BI und need your help.

My source are two tables, 'Issues' and 'Users':

       

I would ike to come to the following result table:

Therefore I would need two n:1 relations.

The first between Issues[Created_by] and Users[ID] and the second between Issues[Assigned_to] and Users[ID].

Power BI tells me that one one connection ist allowed. How can i solve this?

 

Regards Andreas

 

 

  • You can only have 1 relationship active at a time, so if you create a relationship based on the created by column you can add 2 new columns to the issues table like

    Created by Name = RELATED(Users[Name])
    
    Assigned to Name = LOOKUPVALUE( Users[Name], Users[ID], Issues[Assigned to])
  • If you create the relationship between the Issue table and user table through the Created by field, you can use that directly in the visual (in my example the field is seen as "Name"(you can either change the field's name in the Users table to "Created by" or change the actual name for the visual by right-clicking on the field in the visual's bucket and rename it). For the "Assigned to", you can create a measure along the lines of:

    Assigned measure =
    LOOKUPVALUE (
        'Users Table'[Name],
        'Users Table'[ID], MAX ( 'Issues Table'[Assigned to] )
    )
    

     

     

4 Replies

  • You can only have 1 relationship active at a time, so if you create a relationship based on the created by column you can add 2 new columns to the issues table like

    Created by Name = RELATED(Users[Name])
    
    Assigned to Name = LOOKUPVALUE( Users[Name], Users[ID], Issues[Assigned to])
  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    If you create the relationship between the Issue table and user table through the Created by field, you can use that directly in the visual (in my example the field is seen as "Name"(you can either change the field's name in the Users table to "Created by" or change the actual name for the visual by right-clicking on the field in the visual's bucket and rename it). For the "Assigned to", you can create a measure along the lines of:

    Assigned measure =
    LOOKUPVALUE (
        'Users Table'[Name],
        'Users Table'[ID], MAX ( 'Issues Table'[Assigned to] )
    )