Hi ,
using excel 2010,
I want to use PowerPivot (not VBA, or SQL), if that is possible, to solve the following problem:
My model contains two tables.
First, I have a 2 field (columns) combination Matrix table of limits for a maximum investment.
For example:
[TABLE="width: 585"]
<tbody>[TR]
[TD="align: left"]Rating[/TD]
[TD="align: left"]Term[/TD]
[TD="align: left"]Max Aggregate Sum[/TD]
[TD="align: left"]Term|Rating[/TD]
[/TR]
[TR]
[TD="align: left"]AA[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]1000[/TD]
[TD="align: left"]up to 1 Year|AA[/TD]
[/TR]
[TR]
[TD="align: left"]AA[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]900[/TD]
[TD="align: left"]1 year up to 3 Years|AA[/TD]
[/TR]
[TR]
[TD="align: left"]AA[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]800[/TD]
[TD="align: left"]3 Years up to 5 Years|AA[/TD]
[/TR]
[TR]
[TD="align: left"]AA[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]700[/TD]
[TD="align: left"]more then 5 Years|AA[/TD]
[/TR]
[TR]
[TD="align: left"]A+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]800[/TD]
[TD="align: left"]up to 1 Year|A+[/TD]
[/TR]
[TR]
[TD="align: left"]A+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]800[/TD]
[TD="align: left"]1 year up to 3 Years|A+[/TD]
[/TR]
[TR]
[TD="align: left"]A+[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]800[/TD]
[TD="align: left"]3 Years up to 5 Years|A+[/TD]
[/TR]
[TR]
[TD="align: left"]A+[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]500[/TD]
[TD="align: left"]more then 5 Years|A+[/TD]
[/TR]
[TR]
[TD="align: left"]A[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]600[/TD]
[TD="align: left"]up to 1 Year|A[/TD]
[/TR]
[TR]
[TD="align: left"]A[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]600[/TD]
[TD="align: left"]1 year up to 3 Years|A[/TD]
[/TR]
[TR]
[TD="align: left"]A[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]500[/TD]
[TD="align: left"]3 Years up to 5 Years|A[/TD]
[/TR]
[TR]
[TD="align: left"]A[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]300[/TD]
[TD="align: left"]more then 5 Years|A[/TD]
[/TR]
[TR]
[TD="align: left"]BB[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]300[/TD]
[TD="align: left"]up to 1 Year|BB[/TD]
[/TR]
[TR]
[TD="align: left"]BB[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]200[/TD]
[TD="align: left"]1 year up to 3 Years|BB[/TD]
[/TR]
[TR]
[TD="align: left"]BB[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]100[/TD]
[TD="align: left"]3 Years up to 5 Years|BB[/TD]
[/TR]
[TR]
[TD="align: left"]BB[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|BB[/TD]
[/TR]
[TR]
[TD="align: left"]B+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]100[/TD]
[TD="align: left"]up to 1 Year|B+[/TD]
[/TR]
[TR]
[TD="align: left"]B+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]50[/TD]
[TD="align: left"]1 year up to 3 Years|B+[/TD]
[/TR]
[TR]
[TD="align: left"]B+[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]10[/TD]
[TD="align: left"]3 Years up to 5 Years|B+[/TD]
[/TR]
[TR]
[TD="align: left"]B+[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|B+[/TD]
[/TR]
[TR]
[TD="align: left"]B[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]0[/TD]
[TD="align: left"]up to 1 Year|B[/TD]
[/TR]
[TR]
[TD="align: left"]B[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]0[/TD]
[TD="align: left"]1 year up to 3 Years|B[/TD]
[/TR]
[TR]
[TD="align: left"]B[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]3 Years up to 5 Years|B[/TD]
[/TR]
[TR]
[TD="align: left"]B[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|B[/TD]
[/TR]
[TR]
[TD="align: left"]CC[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]0[/TD]
[TD="align: left"]up to 1 Year|CC[/TD]
[/TR]
[TR]
[TD="align: left"]CC[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]0[/TD]
[TD="align: left"]1 year up to 3 Years|CC[/TD]
[/TR]
[TR]
[TD="align: left"]CC[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]3 Years up to 5 Years|CC[/TD]
[/TR]
[TR]
[TD="align: left"]CC[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|CC[/TD]
[/TR]
[TR]
[TD="align: left"]C+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]0[/TD]
[TD="align: left"]up to 1 Year|C+[/TD]
[/TR]
[TR]
[TD="align: left"]C+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]0[/TD]
[TD="align: left"]1 year up to 3 Years|C+[/TD]
[/TR]
[TR]
[TD="align: left"]C+[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]3 Years up to 5 Years|C+[/TD]
[/TR]
[TR]
[TD="align: left"]C+[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|C+[/TD]
[/TR]
[TR]
[TD="align: left"]C[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]0[/TD]
[TD="align: left"]up to 1 Year|C[/TD]
[/TR]
[TR]
[TD="align: left"]C[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]0[/TD]
[TD="align: left"]1 year up to 3 Years|C[/TD]
[/TR]
[TR]
[TD="align: left"]C[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]3 Years up to 5 Years|C[/TD]
[/TR]
[TR]
[TD="align: left"]C[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|C[/TD]
[/TR]
</tbody>[/TABLE]
Second, I have an investment table with a relationship to the first table, using the term|rating field. For example:
[TABLE="width: 599"]
<tbody>[TR]
[TD="align: left"]ID[/TD]
[TD="align: left"]Rating[/TD]
[TD="align: left"]Term[/TD]
[TD="align: left"]sum[/TD]
[TD="align: left"]Term|Rating[/TD]
[/TR]
[TR]
[TD]6195[/TD]
[TD]AA[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]75[/TD]
[TD="align: left"]1 year up to 3 Years|AA[/TD]
[/TR]
[TR]
[TD]7854[/TD]
[TD]A+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]33[/TD]
[TD="align: left"]up to 1 Year|A+[/TD]
[/TR]
[TR]
[TD]4597[/TD]
[TD]BB[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]40[/TD]
[TD="align: left"]more then 5 Years|BB[/TD]
[/TR]
[TR]
[TD]6625[/TD]
[TD]CC[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]100[/TD]
[TD="align: left"]up to 1 Year|CC[/TD]
[/TR]
[TR]
[TD]8362[/TD]
[TD]C+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]50[/TD]
[TD="align: left"]1 year up to 3 Years|C+[/TD]
[/TR]
[TR]
[TD]2802[/TD]
[TD]BB[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]60[/TD]
[TD="align: left"]3 Years up to 5 Years|BB[/TD]
[/TR]
[TR]
[TD]8068[/TD]
[TD]B+[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]70[/TD]
[TD="align: left"]3 Years up to 5 Years|B+[/TD]
[/TR]
[TR]
[TD]4859[/TD]
[TD]AA[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]551[/TD]
[TD="align: left"]up to 1 Year|AA[/TD]
[/TR]
[TR]
[TD]9417[/TD]
[TD]A+[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]422[/TD]
[TD="align: left"]more then 5 Years|A+[/TD]
[/TR]
[TR]
[TD]2387[/TD]
[TD]BB[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]602[/TD]
[TD="align: left"]3 Years up to 5 Years|BB[/TD]
[/TR]
[TR]
[TD]6766[/TD]
[TD]CC[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]366[/TD]
[TD="align: left"]more then 5 Years|CC[/TD]
[/TR]
[TR]
[TD]5062[/TD]
[TD]C+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]731[/TD]
[TD="align: left"]up to 1 Year|C+[/TD]
[/TR]
[TR]
[TD]1970[/TD]
[TD]BB[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]707[/TD]
[TD="align: left"]1 year up to 3 Years|BB[/TD]
[/TR]
[TR]
[TD]9286[/TD]
[TD]B+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]87[/TD]
[TD="align: left"]1 year up to 3 Years|B+[/TD]
[/TR]
</tbody>[/TABLE]
My goal is to make a Pivot table to see where and to what degree do the investments deviate from the Limits as they are explained in the first table.
I was able to build this Pivot by putting the” max Aggregate Sum” in the row label of the pivot:
[TABLE="width: 599"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: left"]I Want to Create this Column Whit PowerPivot[/TD]
[/TR]
[TR]
[TD="align: left"]Term[/TD]
[TD="align: left"]Rating[/TD]
[TD="align: left"]MAX Aggregate Sum[/TD]
[TD="align: left"]Sum of sum[/TD]
[TD="align: left"]MAX Aggregate Sum - Sum of sum[/TD]
[/TR]
[TR]
[TD="align: left"]up to 1 Year[/TD]
[TD="align: left"]A+[/TD]
[TD="align: left"]800[/TD]
[TD="align: right"]33[/TD]
[TD="align: right"]767[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]AA[/TD]
[TD="align: left"]1000[/TD]
[TD="align: right"]551[/TD]
[TD="align: right"]449[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]C+[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]731[/TD]
[TD="align: right"]-731[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]CC[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]-100[/TD]
[/TR]
[TR]
[TD="align: left"]up to 1 Year[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]1415[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD="align: left"]AA[/TD]
[TD="align: left"]900[/TD]
[TD="align: right"]75[/TD]
[TD="align: right"]825[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]B+[/TD]
[TD="align: left"]50[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]-37[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]BB[/TD]
[TD="align: left"]200[/TD]
[TD="align: right"]707[/TD]
[TD="align: right"]-507[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]C+[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]-50[/TD]
[/TR]
[TR]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]919[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD="align: left"]B+[/TD]
[TD="align: left"]10[/TD]
[TD="align: right"]70[/TD]
[TD="align: right"]-60[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]BB[/TD]
[TD="align: left"]100[/TD]
[TD="align: right"]662[/TD]
[TD="align: right"]-562[/TD]
[/TR]
[TR]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]732[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]more then 5 Years[/TD]
[TD="align: left"]A+[/TD]
[TD="align: left"]500[/TD]
[TD="align: right"]422[/TD]
[TD="align: right"]78[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]BB[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]-40[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]CC[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]366[/TD]
[TD="align: right"]-366[/TD]
[/TR]
[TR]
[TD="align: left"]more then 5 Years[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]828[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]Total[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]3894[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I’m experiencing a problem when trying to build a correct measure to subtract the investment from the deviations (without over-summing the deviations).
Can anybody help?
Thanks in advance.
using excel 2010,
I want to use PowerPivot (not VBA, or SQL), if that is possible, to solve the following problem:
My model contains two tables.
First, I have a 2 field (columns) combination Matrix table of limits for a maximum investment.
For example:
[TABLE="width: 585"]
<tbody>[TR]
[TD="align: left"]Rating[/TD]
[TD="align: left"]Term[/TD]
[TD="align: left"]Max Aggregate Sum[/TD]
[TD="align: left"]Term|Rating[/TD]
[/TR]
[TR]
[TD="align: left"]AA[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]1000[/TD]
[TD="align: left"]up to 1 Year|AA[/TD]
[/TR]
[TR]
[TD="align: left"]AA[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]900[/TD]
[TD="align: left"]1 year up to 3 Years|AA[/TD]
[/TR]
[TR]
[TD="align: left"]AA[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]800[/TD]
[TD="align: left"]3 Years up to 5 Years|AA[/TD]
[/TR]
[TR]
[TD="align: left"]AA[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]700[/TD]
[TD="align: left"]more then 5 Years|AA[/TD]
[/TR]
[TR]
[TD="align: left"]A+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]800[/TD]
[TD="align: left"]up to 1 Year|A+[/TD]
[/TR]
[TR]
[TD="align: left"]A+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]800[/TD]
[TD="align: left"]1 year up to 3 Years|A+[/TD]
[/TR]
[TR]
[TD="align: left"]A+[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]800[/TD]
[TD="align: left"]3 Years up to 5 Years|A+[/TD]
[/TR]
[TR]
[TD="align: left"]A+[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]500[/TD]
[TD="align: left"]more then 5 Years|A+[/TD]
[/TR]
[TR]
[TD="align: left"]A[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]600[/TD]
[TD="align: left"]up to 1 Year|A[/TD]
[/TR]
[TR]
[TD="align: left"]A[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]600[/TD]
[TD="align: left"]1 year up to 3 Years|A[/TD]
[/TR]
[TR]
[TD="align: left"]A[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]500[/TD]
[TD="align: left"]3 Years up to 5 Years|A[/TD]
[/TR]
[TR]
[TD="align: left"]A[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]300[/TD]
[TD="align: left"]more then 5 Years|A[/TD]
[/TR]
[TR]
[TD="align: left"]BB[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]300[/TD]
[TD="align: left"]up to 1 Year|BB[/TD]
[/TR]
[TR]
[TD="align: left"]BB[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]200[/TD]
[TD="align: left"]1 year up to 3 Years|BB[/TD]
[/TR]
[TR]
[TD="align: left"]BB[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]100[/TD]
[TD="align: left"]3 Years up to 5 Years|BB[/TD]
[/TR]
[TR]
[TD="align: left"]BB[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|BB[/TD]
[/TR]
[TR]
[TD="align: left"]B+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]100[/TD]
[TD="align: left"]up to 1 Year|B+[/TD]
[/TR]
[TR]
[TD="align: left"]B+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]50[/TD]
[TD="align: left"]1 year up to 3 Years|B+[/TD]
[/TR]
[TR]
[TD="align: left"]B+[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]10[/TD]
[TD="align: left"]3 Years up to 5 Years|B+[/TD]
[/TR]
[TR]
[TD="align: left"]B+[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|B+[/TD]
[/TR]
[TR]
[TD="align: left"]B[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]0[/TD]
[TD="align: left"]up to 1 Year|B[/TD]
[/TR]
[TR]
[TD="align: left"]B[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]0[/TD]
[TD="align: left"]1 year up to 3 Years|B[/TD]
[/TR]
[TR]
[TD="align: left"]B[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]3 Years up to 5 Years|B[/TD]
[/TR]
[TR]
[TD="align: left"]B[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|B[/TD]
[/TR]
[TR]
[TD="align: left"]CC[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]0[/TD]
[TD="align: left"]up to 1 Year|CC[/TD]
[/TR]
[TR]
[TD="align: left"]CC[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]0[/TD]
[TD="align: left"]1 year up to 3 Years|CC[/TD]
[/TR]
[TR]
[TD="align: left"]CC[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]3 Years up to 5 Years|CC[/TD]
[/TR]
[TR]
[TD="align: left"]CC[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|CC[/TD]
[/TR]
[TR]
[TD="align: left"]C+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]0[/TD]
[TD="align: left"]up to 1 Year|C+[/TD]
[/TR]
[TR]
[TD="align: left"]C+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]0[/TD]
[TD="align: left"]1 year up to 3 Years|C+[/TD]
[/TR]
[TR]
[TD="align: left"]C+[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]3 Years up to 5 Years|C+[/TD]
[/TR]
[TR]
[TD="align: left"]C+[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|C+[/TD]
[/TR]
[TR]
[TD="align: left"]C[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]0[/TD]
[TD="align: left"]up to 1 Year|C[/TD]
[/TR]
[TR]
[TD="align: left"]C[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]0[/TD]
[TD="align: left"]1 year up to 3 Years|C[/TD]
[/TR]
[TR]
[TD="align: left"]C[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]3 Years up to 5 Years|C[/TD]
[/TR]
[TR]
[TD="align: left"]C[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]0[/TD]
[TD="align: left"]more then 5 Years|C[/TD]
[/TR]
</tbody>[/TABLE]
Second, I have an investment table with a relationship to the first table, using the term|rating field. For example:
[TABLE="width: 599"]
<tbody>[TR]
[TD="align: left"]ID[/TD]
[TD="align: left"]Rating[/TD]
[TD="align: left"]Term[/TD]
[TD="align: left"]sum[/TD]
[TD="align: left"]Term|Rating[/TD]
[/TR]
[TR]
[TD]6195[/TD]
[TD]AA[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]75[/TD]
[TD="align: left"]1 year up to 3 Years|AA[/TD]
[/TR]
[TR]
[TD]7854[/TD]
[TD]A+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]33[/TD]
[TD="align: left"]up to 1 Year|A+[/TD]
[/TR]
[TR]
[TD]4597[/TD]
[TD]BB[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]40[/TD]
[TD="align: left"]more then 5 Years|BB[/TD]
[/TR]
[TR]
[TD]6625[/TD]
[TD]CC[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]100[/TD]
[TD="align: left"]up to 1 Year|CC[/TD]
[/TR]
[TR]
[TD]8362[/TD]
[TD]C+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]50[/TD]
[TD="align: left"]1 year up to 3 Years|C+[/TD]
[/TR]
[TR]
[TD]2802[/TD]
[TD]BB[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]60[/TD]
[TD="align: left"]3 Years up to 5 Years|BB[/TD]
[/TR]
[TR]
[TD]8068[/TD]
[TD]B+[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]70[/TD]
[TD="align: left"]3 Years up to 5 Years|B+[/TD]
[/TR]
[TR]
[TD]4859[/TD]
[TD]AA[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]551[/TD]
[TD="align: left"]up to 1 Year|AA[/TD]
[/TR]
[TR]
[TD]9417[/TD]
[TD]A+[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]422[/TD]
[TD="align: left"]more then 5 Years|A+[/TD]
[/TR]
[TR]
[TD]2387[/TD]
[TD]BB[/TD]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD]602[/TD]
[TD="align: left"]3 Years up to 5 Years|BB[/TD]
[/TR]
[TR]
[TD]6766[/TD]
[TD]CC[/TD]
[TD="align: left"]more then 5 Years[/TD]
[TD]366[/TD]
[TD="align: left"]more then 5 Years|CC[/TD]
[/TR]
[TR]
[TD]5062[/TD]
[TD]C+[/TD]
[TD="align: left"]up to 1 Year[/TD]
[TD]731[/TD]
[TD="align: left"]up to 1 Year|C+[/TD]
[/TR]
[TR]
[TD]1970[/TD]
[TD]BB[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]707[/TD]
[TD="align: left"]1 year up to 3 Years|BB[/TD]
[/TR]
[TR]
[TD]9286[/TD]
[TD]B+[/TD]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD]87[/TD]
[TD="align: left"]1 year up to 3 Years|B+[/TD]
[/TR]
</tbody>[/TABLE]
My goal is to make a Pivot table to see where and to what degree do the investments deviate from the Limits as they are explained in the first table.
I was able to build this Pivot by putting the” max Aggregate Sum” in the row label of the pivot:
[TABLE="width: 599"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: left"]I Want to Create this Column Whit PowerPivot[/TD]
[/TR]
[TR]
[TD="align: left"]Term[/TD]
[TD="align: left"]Rating[/TD]
[TD="align: left"]MAX Aggregate Sum[/TD]
[TD="align: left"]Sum of sum[/TD]
[TD="align: left"]MAX Aggregate Sum - Sum of sum[/TD]
[/TR]
[TR]
[TD="align: left"]up to 1 Year[/TD]
[TD="align: left"]A+[/TD]
[TD="align: left"]800[/TD]
[TD="align: right"]33[/TD]
[TD="align: right"]767[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]AA[/TD]
[TD="align: left"]1000[/TD]
[TD="align: right"]551[/TD]
[TD="align: right"]449[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]C+[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]731[/TD]
[TD="align: right"]-731[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]CC[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]-100[/TD]
[/TR]
[TR]
[TD="align: left"]up to 1 Year[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]1415[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD="align: left"]AA[/TD]
[TD="align: left"]900[/TD]
[TD="align: right"]75[/TD]
[TD="align: right"]825[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]B+[/TD]
[TD="align: left"]50[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]-37[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]BB[/TD]
[TD="align: left"]200[/TD]
[TD="align: right"]707[/TD]
[TD="align: right"]-507[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]C+[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]-50[/TD]
[/TR]
[TR]
[TD="align: left"]1 year up to 3 Years[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]919[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD="align: left"]B+[/TD]
[TD="align: left"]10[/TD]
[TD="align: right"]70[/TD]
[TD="align: right"]-60[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]BB[/TD]
[TD="align: left"]100[/TD]
[TD="align: right"]662[/TD]
[TD="align: right"]-562[/TD]
[/TR]
[TR]
[TD="align: left"]3 Years up to 5 Years[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]732[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]more then 5 Years[/TD]
[TD="align: left"]A+[/TD]
[TD="align: left"]500[/TD]
[TD="align: right"]422[/TD]
[TD="align: right"]78[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]BB[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]-40[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]CC[/TD]
[TD="align: left"]0[/TD]
[TD="align: right"]366[/TD]
[TD="align: right"]-366[/TD]
[/TR]
[TR]
[TD="align: left"]more then 5 Years[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]828[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]Total[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]3894[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I’m experiencing a problem when trying to build a correct measure to subtract the investment from the deviations (without over-summing the deviations).
Can anybody help?
Thanks in advance.