Incorrect Count Subtotal in Pivot Table Calculated Field

admiral_pelican

New Member
Joined
Jan 18, 2019
Messages
4
Hello,

I have a report with a date slicer that returns, by sales manager, by sales rep, by account, the current period revenue and prior year revenue for the sliced date range. I need to add a column that counts the number of accounts with revenue in the current period. The data source is such that adding a helper column to it almost certainly won't help. My approach so far is to insert calculated field, IF(Total Revenue>0,1,0), which returns a 1 next to each advertiser with current period revenue. My problem is that, for each sales rep, it doesn't return a subtotal of the number of accounts under him/her with a 1 next to them -- it just returns a 1, and same for sales manager and same for grand total. I need the calculated field to essentially sumifs itself at the subtotal and grand total levels.

Can anyone help me return a correct count subtotal in a Pivot Table calculated field?

Please assist.

[TABLE="width: 802"]
<tbody>[TR]
[TD] SM[/TD]
[TD] AE[/TD]
[TD] Advertiser[/TD]
[TD] Current Revenue[/TD]
[TD] # Accounts[/TD]
[/TR]
[TR]
[TD] SM1[/TD]
[TD][/TD]
[TD][/TD]
[TD]244,542[/TD]
[TD] (sum of all SM's accounts)[/TD]
[/TR]
[TR]
[TD] SM1[/TD]
[TD] AE1[/TD]
[TD][/TD]
[TD]6,745[/TD]
[TD] 2[/TD]
[/TR]
[TR]
[TD] SM1[/TD]
[TD] AE1[/TD]
[TD] Advertiser 1[/TD]
[TD] -[/TD]
[TD] -[/TD]
[/TR]
[TR]
[TD] SM1[/TD]
[TD] AE1[/TD]
[TD] Advertiser 2[/TD]
[TD] 3,519[/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD] SM1[/TD]
[TD] AE1[/TD]
[TD] Advertiser 3[/TD]
[TD] -[/TD]
[TD] -[/TD]
[/TR]
[TR]
[TD] SM1[/TD]
[TD] AE1[/TD]
[TD] Advertiser 4[/TD]
[TD] -[/TD]
[TD] -[/TD]
[/TR]
[TR]
[TD] SM1[/TD]
[TD] AE1[/TD]
[TD] Advertiser 5[/TD]
[TD] 3,226[/TD]
[TD] 1[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
FYI, after digging deeper I'm pretty sure there's no way for a calculated field to help me with this, because calculated fields apply the same formula to subtotals and total columns as they do to other columns. My solution is pretty complicated. I'm going to create a separate sheet with 19 different value calculations based on the 19 different likely date selections (1 for each month, quarter, half, and full year), and I'm going to return the filtered values in a way that returns the values of the correct date case into the pivot table source data. final piece is to add a macro that automatically updates the pivot table when changes are made to the source data. heh.
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,136
Members
453,021
Latest member
Justyna P

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