PowerPivot: Show a category in a table with One to many relationship

bright_mind

New Member
Joined
Apr 1, 2013
Messages
5
I have Table A and Table B

Table A has the unique personnel ID
Table B has the the field "Category" where personnel ID can have multiple categories selected, e.g.,

Table A:
Key Name
1 John
2 Jacob
3 Jane

Table B:
Key Category Sub Category
1 Personnel Type Management
1 Job Level Director
1 Hire Type Internal
2 Personnel Type Clerk
2 Job Level Career
2 Hire Type External
3 Personnel Type Management
3 Hire Type External


What formula should I enter in a calculated field in PowerPivot if I would like to show in Table A the value for "Job Level"? I understand that Related function won't work?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Why do you want this in Table A? You should avoid this. What are you trying to acheive? How about create a pivot, place TableA[name] on rows, then write this measure and place on values.

Job Level Measure = calculate(if(hasonevalue(tableB[sub category]),values(tableB[sub category])),TableB[Category]="Job level")

this first filters table B so only job level is unfiltered, then returns the single value of sub category (as long as there is a single value)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,721
Members
449,093
Latest member
Mnur

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