Search code examples
powerquerypowerpivot

Power Pivot: simple relationship between 2 tables


I am just getting started with Power Pivot. I have 2 tables:

EE_ID NAME
123 Werner
124 Karl

and

SUP_ID NAME
321 Miriam
521 Jasmin

actually those are related, so I created another table, which describes the relationship

EE_ID SUP_ID
123 321
123 521

I connected them no in Power Pivot foreign key / primary key. I thought I can run now a query which spits out

  • Werner and than, somehow
  • Miriam
  • Jasmin

But I don't get to the list, where am I doing something wrong ?

Thanks for your help!

Hans


Solution

  • If you have defined a relation ship in the right way then you only need to use the related function in the table which describes the relationship in order to populate one column with the superior's name and another one with the employee's name.

    This is the view before defining these extra columns enter image description here

    Them you add two columns in tblRelation with enter image description here

    The table should then look like that enter image description here

    Now you only need to add a pivottable in compact format adding employee and superior to the rows

    enter image description hereenter image description here

    Result is

    enter image description here