Matrix type calculation for PowerPivot

chaserracer83

New Member
Joined
Oct 8, 2012
Messages
27
Good afternoon, I am trying to do a tricky little calculation. It requires filtering values from the current table, and multiplying them by values in another table through a matrix type process. The original formula in Excel uses MMULT. I've tried several things, but nothing accomplishes what I am looking to do...

I have two tables, lets call them "Data" and "Timing". Data contains three fields; Key, Month, and Loss. Timing contains two fields; Month, and Timing Curve.

I need a field in the Data table that does the following:
1) Filters for records in the Data table that have the same Key, a Month less than or equal to the current record, and no Month that is less than the current record Month-20
2) For each record not filtered out from the calculation, the Loss number is multiplied by the Timing Curve from the Timing table. The Timing Curve value that is multiplied depends on how many months have passed since the current record. So for example, imagine a record in the Data table, for a particular key, where month is 10:
The function would take the Loss number for this record and multiply it by Timing Curve at Month 1 (because its been one month since this loss happened).
Then it would take the loss number for month 9 and multiply it by Timing Curve at Month 2
Then it would take the loss number for month 8 and multiply it by Timing Curve at Month 3, and so on...
For a record where month is 11, 10 would be multiplied by Timing Curve at Month 2 because 10 is now one month older
3) After the function has calculated the product of each Loss number with the Timing Curve, it sums up all the values

Hopefully there is an easy solution for this because it has really tripped me up. I have created a sample set of data that can be downloaded at:
https://www.dropbox.com/s/r35bxy7vvvlv1mr/Sample Data.xlsx?dl=0

Any help you are able to offer on this is greatly appreciated.

Thank you,
Chase
 
Owen, my solution was "going to be" like your second one. I was stuck on the lookup value portion. I was experimenting with using max() to harvest the data[month] value, but that wasn't working. I had just started with earlier when you posted your reply - pheeew, what a relief :-).

I was was planning to iterate over ALL(Data[Key],Data[Month]) and wrap the whole thing in a calculate that contained a suitable filter similar to yours (without the earlier of course).
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

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