Excel Power Pivot Ignoring relationship

nd0911

Board Regular
Joined
Jan 1, 2014
Messages
166
I'm new with all the "power" family in excel, and for a test, i'm trying to join 2 super simple tables and display the results on a pivot table.

The data you can see here:
0.png


The tables and the connections between them you can see here (connection between the Product ID's)
1.png


The pivot table results:
2.png



The results I'm expecting to get
3.png


What i'm doing wrong ?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Instead of Power Pivot, I would use Power Query

Power Query:
let
    Source = Table.NestedJoin(Table1, {"Procuct ID"}, Table2, {"Product ID"}, "Table2", JoinKind.RightOuter),
    #"Expanded Table2" = Table.ExpandTableColumn(Source, "Table2", {"Order ID"}, {"Table2.Order ID"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Table2",{"Procuct ID"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Table2.Order ID", "Product Name", "Cost"})
in
    #"Reordered Columns"
 
Upvote 0
Instead of Power Pivot, I would use Power Query

Power Query:
let
    Source = Table.NestedJoin(Table1, {"Procuct ID"}, Table2, {"Product ID"}, "Table2", JoinKind.RightOuter),
    #"Expanded Table2" = Table.ExpandTableColumn(Source, "Table2", {"Order ID"}, {"Table2.Order ID"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Table2",{"Procuct ID"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Table2.Order ID", "Product Name", "Cost"})
in
    #"Reordered Columns"

But do you know want i'm doing wrong ?
 
Upvote 0
anvg's measure is the solution. I hadn't read it properly, and so recreated your problem and then came to the same answer. It does seem counter-intuitive to me that your original scheme didn't filter the sum as you'd expect. But by adding 'tbl_orders' to the measure you do something called 'cross table filtering', which I read about in a number of posts dealing with many-to-many relationships.

HTH
 
Upvote 0

Forum statistics

Threads
1,223,757
Messages
6,174,330
Members
452,555
Latest member
colc007

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