Create relationship with duplicate foreign key

brian0782

New Member
Joined
Jun 9, 2014
Messages
4
Hi everyone

I'm new to Powerpivot and data modelling (somewhat). I have a fairly easy relationship I'm trying to create but getting stuck. I'm sure the answer is easy!

What I'd like to do is link these two tables by Transaction ID but getting a duplicate key error on the second table. I want to summarize the transaction amounts (row label) by line items paid (column label).

Again, I'm sure this is quite obvious but what am I doing wrong?

Thanks in advance, Brian

[TABLE="width: 500"]
<tbody>[TR]
[TD]Transaction Id[/TD]
[TD]Transaction Total[/TD]
[TD]Transaction Date[/TD]
[/TR]
[TR]
[TD][TABLE="width: 266"]
<tbody>[TR]
[TD="width: 266"]OLP109388[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]63[/TD]
[TD]19/07/2014[/TD]
[/TR]
[TR]
[TD][TABLE="width: 266"]
<tbody>[TR]
[TD="width: 266"]OLP109386[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]63[/TD]
[TD]19/07/2014[/TD]
[/TR]
[TR]
[TD][TABLE="width: 266"]
<tbody>[TR]
[TD="width: 266"]OLP109394[/TD]
[/TR]
</tbody>[/TABLE]

[/TD]
[TD]65.85[/TD]
[TD]19/07/2014[/TD]
[/TR]
</tbody>[/TABLE]


[TABLE="width: 500"]
<tbody>[TR]
[TD]Transaction Item Id[/TD]
[TD]Transaction Id[/TD]
[TD]Transaction Item Total[/TD]
[TD]Transaction Item Amount[/TD]
[TD]Product Code[/TD]
[TD]Transaction Item Date[/TD]
[/TR]
[TR]
[TD]1000001[/TD]
[TD]OLP109388[/TD]
[TD]63[/TD]
[TD]63[/TD]
[TD]301010[/TD]
[TD]19/07/2014[/TD]
[/TR]
[TR]
[TD]1000002[/TD]
[TD]OLP109386[/TD]
[TD]63[/TD]
[TD]63[/TD]
[TD]301020[/TD]
[TD]19/07/2014[/TD]
[/TR]
[TR]
[TD]1000003[/TD]
[TD]OLP109394[/TD]
[TD]63[/TD]
[TD]63[/TD]
[TD]301020[/TD]
[TD]19/07/2014[/TD]
[/TR]
[TR]
[TD]1000004[/TD]
[TD]OLP109394[/TD]
[TD]2.85[/TD]
[TD]2.85[/TD]
[TD]101010[/TD]
[TD]19/07/2014[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
At least one of the tables must have only unique values in the table, on the field you are linking by relationship. It appears you have duplicates... you need to clean that up.
 
Upvote 0

Forum statistics

Threads
1,224,027
Messages
6,175,988
Members
452,692
Latest member
Emy12

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