Confused on Pivots - how to only include original data >= x

JohnKauffman

New Member
Joined
Nov 1, 2012
Messages
36
I have never before had to perform this simple objective with PT.

How can I make a rule that determines which values from the original data are used in the aggregate? For example if MyCol is the aggregate, how can I only include values from MyCol that are >10? Note that MyCol is used as the aggregate, not a row or col. Row and Col fields can be filtered with Value Filter, Label Filter, Checkboxes

Example:
Worksheet of house sales. Each row is one sale. Cols are ID, Price, Type, City.
PT has Type as rows, City as col and Price as the aggregate.
How can I include in the PT aggregate results only the cases where the price was <$200?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
The PivotTable itself can only filter using the aggregate values. Two options to filter based on the individual records are:

1. Add an additional field to the data source. Use a formula in that field that will evaluate to True or False based on whether each record meets the criteria.
This added field can then be used as a Report Filter to restrict the data reported to those records meeting the criteria.
The formula can reference a cell on the same sheet as the Pivot to allow dynamic changes to the criteria, however the PivotTable will need to be refreshed any time the criteria is changed.

2. An SQL query can be used to return a modified dataset which is then used as the datasource for the Pivot. The query could add a field that would allow Filtering by record (similar to Option #1), or it could restrict the records placed in the datasource to those meeting the criteria.
 
Upvote 0

Forum statistics

Threads
1,215,566
Messages
6,125,589
Members
449,237
Latest member
Chase S

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