Bringing a value from another table without using related

kizofilax

New Member
Joined
Sep 10, 2012
Messages
8
Hello, here is what I have

Casepk
2121
12122
4441
1113

<tbody>
</tbody>


Table B

pkcategory
1muffin
2bagel
3pizza
4toast

<tbody>
</tbody>


I created a relationship between them and i know i can go to table A and do related(TableB'category'), the problem is that this creates another table and what I want to do is create a pivot table from A and show this:

casecategory
212muffin
1212bagel
444muffin
111pizza

<tbody>
</tbody>


I need to show this table in this format as a pivot table (people want to see the category for each case)

If I just do this with that relationship what I get is something that looks like this:

111
bagel
muffin
pizza
toast

<tbody>
</tbody>

Its as if the relationship wasn't being recognized, any idea how to do this?

Thanks
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi kizofilax,

As per your sample data, I think you can have the same output using tables. This approach is simpler to construct, smart and expandable, and you don’t have to worry about extending the formulae or expanding the tables.

One simple VLOOKUP() formula is required to bring the category from table B into table A for each pk value.
 
Upvote 0
The issue is that the first table (I'll call it Table A) is on the many side of the relationship and Table B is on the one side. Filtering only ever flows from the one side to the many side. So when you put CASE from Table A in your pivot table rows, it will not filter Table B. When you then add CATEGORY from Table B to rows in your pivot, it is completely unfiltered and hence all values are visible in your Pivot. You could fix this by creating a measure that DOES filter TABLE B. Something like this

=CALCULATE(COUNTROWS(TableA),TableB)

Here is a sample workbook https://dl.dropboxusercontent.com/u/30711565/cross filter.xlsx
 
Upvote 0

Forum statistics

Threads
1,216,196
Messages
6,129,462
Members
449,511
Latest member
OttosArmy

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