Powerpivot - Allocation of values to Bands

Patro

New Member
Joined
May 8, 2019
Messages
6
Hi,

I want to allocate some limit values into Limit Bands based on certain conditions. I have two tables in powerpivot and I am trying using DAX functions to do it. The two tables are the following,

1. A table with limit values (Named "Exposure") with the following fields,


IDAttachmentLimit
120,000,00050,000,000
2 30,000,000 80,000,000

<tbody>
</tbody>


<tbody>
</tbody>
2. A table (Named "Bands") with the limit bands,



Limit BandsMin LimitMax Limit
0M-25M0M25M
25M-50M25M50M
50M-75M50M75M
75M-100M75M100M
100M-150M100M150M
150M-250M150M250M
250M-500M250M500M
500M-1000M500M1,000M
1000M-1000M+1,000M1,000,000M

<tbody>
</tbody>


What I want to do is to allocate the Limits in the first table (Named "Exposure") to the Limit Bands of the second table. The "Attachment" is the amount after which the Limit starts. For example for ID=1 the limit starts at 20M hence the allocation to the band will start in the first band and will be as follows,

Limit BandsMin LimitMax LimitAllocation
0M-25M0M25M5M
25M-50M25M50M25M
50M-75M50M75M20M
75M-100M75M100M0M
100M-150M100M150M0M
150M-250M150M250M0M
250M-500M250M500M0M
500M-1000M500M1,000M0M
1000M-1000M+1,000M1,000,000M0M

<tbody>
</tbody>

For ID=2 the allocation should start from the second Band as the attachment point is 30M and should be as follows,



Limit BandsMin LimitMax LimitAllocation
0M-25M0M25M0M
25M-50M25M50M20M
50M-75M50M75M25M
75M-100M75M100M25M
100M-150M100M150M10M
150M-250M150M250M0M
250M-500M250M500M0M
500M-1000M500M1,000M0M
1000M-1000M+1,000M1,000,000M0M

<tbody>
</tbody>


For both IDs the allocation should be,

Limit BandsMin LimitMax LimitAllocation
0M-25M0M25M5M
25M-50M25M50M45M
50M-75M50M75M45M
75M-100M75M100M25M
100M-150M100M150M10M
150M-250M150M250M0M
250M-500M250M500M0M
500M-1000M500M1,000M0M
1000M-1000M+1,000M1,000,000M0M

<tbody>
</tbody>

I hope my explanation is clear.

Your help is much appreciated!!!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi All,

I worked out a formula that works for a single row table (that is, when I only have one limit to allocate). When I add more rows to the table, I think there is an issue with the aggregation of the amounts. Could you please help?

The formula that works for a single limit value is the following,

Alloc:=SUMX(Bands,


IF(VALUES(XoL_Exposure[Sum of Att+Limit])<FIRSTNONBLANK(Bands[Max Limit],1),

MAX(VALUES(XoL_Exposure[Sum of Att+Limit])-FIRSTNONBLANK(Bands[Min Limit],1),0),

IF(VALUES(XoL_Exposure[Attachment])<FIRSTNONBLANK(Bands[Max Limit],1),

MIN(MAX(FIRSTNONBLANK(Bands[Max Limit],1)-VALUES(XoL_Exposure[Attachment]),0),FIRSTNONBLANK(Bands[Max Limit],1)-FIRSTNONBLANK(Bands[Min Limit],1))

)
)
)

Where Att + Limit column is a calculated column that sums the limit and the attachment.
 
Upvote 0
Sorry, the formula I am using is the following,

SUMX( 'Bands',
IF(VALUES(XoL_Exposure[Sum of Att+Limit])<FIRSTNONBLANK(Bands[Max Limit],1),

MAX(VALUES(XoL_Exposure[Sum of Att+Limit])-FIRSTNONBLANK(Bands[Min Limit],1),0),

IF(VALUES(XoL_Exposure[Attachment])<FIRSTNONBLANK(Bands[Max Limit],1),

MIN(MAX(FIRSTNONBLANK(Bands[Max Limit],1)-VALUES(XoL_Exposure[Attachment]),0),FIRSTNONBLANK(Bands[Max Limit],1)-FIRSTNONBLANK(Bands[Min Limit],1))

)
)
)
 
Upvote 0
SUMX('Bands',
IF(VALUES(XoL_Exposure[Sum of Att+Limit]) <firstnonblank(bands[max limit],1),
< FIRSTNONBLANK(Bands[Max Limit],1),


MAX(VALUES(XoL_Exposure[Sum of Att+Limit])-FIRSTNONBLANK(Bands[Min Limit],1),0),

IF(VALUES(XoL_Exposure[Attachment]) <firstnonblank(bands[max limit],1),
< FIRSTNONBLANK(Bands[Max Limit],1),


MIN(MAX(FIRSTNONBLANK(Bands[Max Limit],1)-VALUES(XoL_Exposure[Attachment]),0),FIRSTNONBLANK(Bands[Max Limit],1)-FIRSTNONBLANK(Bands[Min Limit],1))

)
)
)</firstnonblank(bands[max></firstnonblank(bands[max>
 
Upvote 0

Forum statistics

Threads
1,215,745
Messages
6,126,636
Members
449,324
Latest member
AmirMalik

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