Creating a 2-way relationship between two tables in PowerPivot

zacc206

New Member
Joined
Jul 17, 2013
Messages
4
Hi Everyone,

I am having problems finding information around this (perhaps I am not searching with the right keywords), but it seems like it would be a common function of PowerPivot so I came here.

I'd like to create a relationship where I can find a value in table A only when it is not present in table B. Additionally, I'd like to find a value in table B only when it is not present in table A.

I've tried creating a 2-way relationship in PowerPivot but Excel won't let it happen.

I'd like to know:
  • Can I create a 2-way relationship in PowerPivot?
    -or-
  • Does PowerPivot have the ability to combine 2 existing tables into a virtual table where I could then select values from?

THis would be similar to what would happen in SQL using a JOIN, but I do not understand PowerPivot enough to be able to emulate advanced relationships like this.

Much of what I can find are posts about merging identical tables using PowerPivot. My data set has unique columns with one column acting as a primary key.

I am using Excel 2013 on Windows 8.
 
PowerPivot only allows one relationship directly between two tables and at least one of those must have unique values in the column on which the relationship is based.

You don't give any details about the specifics of what you are trying to do but there are a few options:
- use a separate 'central' table of just the unique values connected to both of your current tables may do the job, you can then write measures that do the IF/THEN logic.
- you could combine the tables on import using 'UNION (ALL)', the way to get round possible duplication is to mark the row with the table it came from.
- you could combine the tables using Power Query.

Hope this helps.
Jacob
 
Upvote 0
Hi Jacob,

The data set I am working with has to do with names of employeesand a team each employee is associated with.

Table A - Contains"First Name" column and "Last Name" column. This is theactive employee roster.
Table B - Contains"Full Name" column and "Team Assignment" column. Thisis a list of everyone who's ever been assigned a team (active and non-active).

To create the primary key, I created a calculated column thatconcatenated "First Name" and "Last Name" in Table A (usingPowerPivot).

I am trying to determine:
- Which active employees in Table A do not have a teamassignment (from Table B)
- Which employees from Table B are active employees (from TableA)

The concept of a central table is what I was looking for.Attempting now to do this with Power Query, but I am running into issues.

I might be handling the primary key incorrectly (since I amcalculating it in PowerPivot). If Table A (active roster) is a dynamicallychanging data set (i.e. people drop and add on each refresh), how would I makea primary key? I could create an arbitrary employee ID (1,2,3,4,5,etc.) inTable A, but it would only be accurate until I repopulated the list.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top