How to use the prior month value in a calculation inside a pivot table?

stewstremel

New Member
Joined
Feb 10, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to work with a rolling inventory projection. The core issue we have is that some sites report inventory on a quarterly basis. We are generating reports on a monthly basis. We take the known orders/shipments for the month, add that to the inventory and then subtract consumption to establish a project inventory. This works if we have inventory every month, but when we don't (or when we want to project it into the future) then pivot table breaks down.

What I am hoping to find a way to do is to take the prior months projected inventory and use that for the current month starting point. Is this possible?

pivot table Image attached.

Sample Table:
sample.xlsx
ABCDEFGH
1L5Anchor Date NametheDateMonthly InventoryForecastRequested QtyRemaining QtyShipment Shipped Qty
2Product ASupply Plan Date2020-01-0111672029743
3Product ASupply Plan Date2020-02-01091125
4Product ASupply Plan Date2020-03-01091125
5Product ASupply Plan Date2020-04-0131800577732
6Product AShipment Estimated Ship Date2020-04-0176896
7Product AOrder Estimated Ship Date2020-04-010
8Product AShipment Estimated Delivery Date2020-04-2076896
9Product AOrder Estimated Delivery Date2020-04-200
10Product ASupply Plan Date2020-05-01077732
Horizontal Table



I have attempted the following calculated field but it isn't working for me. Any help is appreciated.
=if ( sum([Monthly Inventory]) > 0
, sum([Monthly Inventory]) - sum([Forecast])
, calculate(sum([Monthly Inventory]), PREVIOUSMONTH([theDate]) ) - sum([Forecast])
)

Cheers,
 

Attachments

  • pivot.PNG
    pivot.PNG
    10.4 KB · Views: 21

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,215,584
Messages
6,125,678
Members
449,248
Latest member
wayneho98

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