filter pivot table

cblechle

New Member
Joined
Sep 20, 2010
Messages
7
Is there a way to filter a pivot table based on the sum values Field? What i have in the raw data is a row that contains the VIN, Make, Model, office the vehicle is located, Month, year, and the total fuel for that month. What i am doing is using a pivot table to show the months in the columns field, vehicle info in the rows, and the sum of fuel purchased for that month. What i then need to do is filter out all vehicles whos total fuel is less than 100 gallons for all the months. Is there any way to do this?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi,

Some sample data would help. Maybe it can be done by just filtering the pivot table: so from the finished PT select the cell one to the right of the topmost table cell, and also the top RHS cell. Then apply a normal auto-filter ALT-D-D-F and filter as required.

Or add a new field to the source data, using say a GETPIVOTDATA function to populate the new field with the required total. Modify the formula to something like, =GETPIVOTDATA(whatever)<100 or whatever works for you to return TRUE or FALSE values to do the desired filtering. Use this new field as a page field in the pivot table setting it to TRUE or FALSE to suit. You will need to refresh the pivot table twice to get the desired result.

Or, and this is more advanced, you can do the filtering in SQL. So set up the pivot table from an external source (you can move it into your source file once created) with SQL something like below. Unchecked.

HTH. Regards, Fazza

Code:
SELECT VIN, Make, Model, YourMonth, Fuel
FROM YourData
GROUP BY VIN, Make, Model, YourMonth
HAVING SUM(Fuel)>=100
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

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