Filtering a pivot table report using a calculated column

LBala

New Member
Joined
Apr 3, 2014
Messages
22
Hi;

I have a sales report linked with an inventory table (current quantity available by item). Here is a picture of the diagram view:
30w15ie.jpg


In the "Inventory" table I have a calculated column to indicate if the quantity on-hand of an item (QtyOH) is positive or negative. The calculated column is named "OH_Qty_Status" (on-hand quantity status). The calculated column formula is: =IF((Inventory[QtyOH]) < 0, "Negative", "Positive")

I have created a pivot table report with the filters "State" and "OH_Qty_Status" on top. I am filtering the state "TX" and "OH_Qty_Status" equal to "Negative". As I wanted, only the items with less than zero quantity are showing.
Here is a picture of the pivot table report:

2hmnh2e.jpg


I have also created a calculated field named "QtySold_Last30days".
QtySold_Last30days: =CALCULATE([TotQtySold],DATESBETWEEN(Calendar[Date],TODAY()-30,TODAY()))

Where, TotQtySold: =SUM(Sales[Qty_Sold])

The problem is that when I add the column "QtySold_Last30days" in the pivot table report all other items show up. Here is a picture of the pivot table with all items showing:

10ngqxt.jpg


Is there a way to change the formula in the calculated field "QtySold_Last30days" and have it in a way that when it is dropped in the pivot table report only the items with negative quantity show up (like the picture below)?

2zrkfpx.jpg


Note: I can not link the "Inventory" and "Sales" tables because the columns contain duplicate values.

The excel file I am working with is uploaded here (394KB):
https://www.dropbox.com/s/wz41cviuovt3c42/Report_FSA.xlsx?dl=0

Thanks.
 

Excel Facts

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

Forum statistics

Threads
1,224,163
Messages
6,176,789
Members
452,743
Latest member
Unique65

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