Filtering Summed Values

kellwood

New Member
Joined
Jun 26, 2019
Messages
4
Date

Name
Amount
June 1
Bob
5
June 1
Bob
6
June 1
Doug
5
June 2
Bob
5
June 2
Doug
7
June 2
Doug
4
June 3
Bob
5
June 3
Bob
3
June 3
Doug
8
June 3
Doug
4

<tbody>
</tbody>

I'd like to pivot the above data with Names in the rows, Dates in the columns, and the sum of the amounts for each person each day in the values. I know how to do this. My problem is I would like to filter the values to only show days that are greater than 10. Example Doug's sum of 5 on June 1 would be filtered out of the table (display as blank cell). Bob's sum on June 1 would be displayed as 11 because the sum is greater than 10.

Is this possible? When I attempt it, my summed values filter based on the Grand Total, which doesn't help me.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
maybe

DateNameAmountDateNameSum Amount
01/06/2019​
Bob
5​
01/06/2019​
Bob
11​
01/06/2019​
Bob
6​
02/06/2019​
Doug
11​
01/06/2019​
Doug
5​
03/06/2019​
Doug
12​
02/06/2019​
Bob
5​
02/06/2019​
Doug
7​
02/06/2019​
Doug
4​
03/06/2019​
Bob
5​
03/06/2019​
Bob
3​
03/06/2019​
Doug
8​
03/06/2019​
Doug
4​

with PowerQuery (Get&Transform)

Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Name", type text}, {"Amount", Int64.Type}}),
    Group = Table.Group(Type, {"Date", "Name"}, {{"Sum Amount", each List.Sum([Amount]), type number}}),
    Filter = Table.SelectRows(Group, each [Sum Amount] > 10)
in
    Filter[/SIZE]
 
Upvote 0
Thanks Sandy. I am not familiar with PowerQuery....but I'll certainly check it out now. Any way do get the same result in a pivot table?
 
Upvote 0
sure

DateNameSum of Amount
01/06/2019
Bob
11​
02/06/2019
Doug
11​
03/06/2019
Doug
12​

ptwithfilter.jpg
 
Last edited:
Upvote 0
Thanks again Sandy. Sorry for my ignorance, but I am still messing it up somehow. When I drop the Dates and Names into the Rows field like you have shown my pivot table displays differently than yours....my Names are sub rows under the Dates...not another column like yours is shown.
 
Upvote 0
hi,

The simple filtering explained by Sandy is great. Hopefully that is sufficient for your requirements.

Below are some other ideas FYI.

One way with an existing pivot table is to add another field to the source data. Say "ShowIt".
Populate with a formula that links to the pivot table, something like
=GETPIVOTDATA(references to get the total you want to check against)>10
Now make a second pivot table & put the ShowIt field as a page field to filter for TRUE.
Refresh the first then the second pivot table if data changes.


More complex is if you want the result directly in a pivot table, and without adding an extra field to the data. This can be done by creating a dataset that already has the filtering.
Such as defining the dataset by, untested
Code:
SELECT A.[Date], A.Name, A.Amount
FROM YourDataName A
GROUP BY A.[Date], A.Name
HAVING SUM(A.Amount) > 10

This works in all versions of pivot tables, BTW. Detailed steps follow, or search for examples via Google.
When the source data has simple defined name "YourDataName". Such as select the data then CTRL-F3 & define the named range, or via the name box at top LHS.
Field name "Date" may be a problem - hopefully enclosing in brackets avoids issues.
Having saved the data file, safest for earlier Excel versions is to then have a new file when creating the pivot table.
So, CTRL-N for a new Excel file
ALT-D-P to start the pivot table wizard
external data source at the first stop then follow the wizard to the end choosing the option then to edit in MS Query.
Via the SQL button define the dataset as above, OK to enter & OK again if you get a message. See the results set.
Via the open door button exit MS Query & complete the pivot table.
Having created the pivot table on a worksheet, you can if you want move the entire worksheet to the same workbook as the data.


regards, Fazza
 
Upvote 0
Thanks Sandy, that works! Thank you too Fazza! Last question...how do I close the thread or marked solved? (I'm new)
 
Upvote 0
just say thanks , click bottom left buttons Thanks/Like in appropriate post/s - that's all :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,525
Members
448,969
Latest member
mirek8991

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