Power Pivot appears to ignore relationships

csabz09

New Member
Joined
Jun 5, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi All!

I am trying to use a filter table to simply filter two other tables in Power Pivot, however, it looks like the relationship is not respected as soon as I add 'col1' from my first table and 'col2' from my second table.

I have a 'filter table' that I am trying to use to filter two other tables with it.

My filter table looks like this:
1622911977532.png

The first table it filters looks like this:
1622912019784.png

And the second table it filters looks like this:
1622912045346.png


I have set up the relationships as per this screenshot:
1622912092160.png


My desired output is this:
1622912523404.png


However, when I try to construct such a pivot table, it looks returns all col1-col2 combinations as if the filter did not even exist:
1622912594731.png


Here is the link to the file if anyone wants to take a look: weird.xlsx

Any tips on how to make this work? When I try to do the same in Power BI, it works well so I am extremely confused.

Thanks a lot!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
The relationship you have does not appear to make sense and Power Pivot can't work it out.

1622967224743.png


When you assign a 1 to 2-ac, is it supposed to go against 2-xy or 2-xz or both ?
That type of relationship won't work in the Data Model.

1622967390320.png
 
Upvote 0
Either way I managed to make it work as per my requirements using a DAX formula, which does a row count for both tables that should be subject to the filter, and only returns values when the row count in both tables is larger than 0, and in any other case it returns BLANK. This way I only get category values that indeed belong to the keys coming from the filter table.

sum_val =IF(COUNTROWS(table1) > 0 && COUNTROWS(table2) > 0, SUM(table2[value]), BLANK())

Output:
1622980305253.png
 
Upvote 0
Solution
(And sorry for the wrong terminology, I should have called the join keys of my tables to be filtered 'foreign keys')
 
Upvote 0
Thanks for letting me know. Glad you worked out a way to come up with the result you were after.
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

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