Thanks. This is essentially what I did. The problem is that when you sum a subgroup, it eliminates one pair of field / item qualifiers in the GETPIVOTDATA formula, so you can’t apply the same formula across the entire sheet if you are going to switch between showing summary and detail.
=IFERROR(GETPIVOTDATA("ItemNum",PivotStateTotal!$B $5,"CurFlag",$C24,"EventCd",$B24,"MonthYear",AH$4, "StateGroup",$F$8), 0)
When summarizing data, needs to then become (notice StateGroup is no longer there):
=IFERROR(GETPIVOTDATA("ItemNum",PivotStateTotal!$B $5,"CurFlag",$C24,"EventCd",$B24,"MonthYear",AH$4 )
To work around that, I’m repeating the formula twice (once with 4 qualifiers and once with 5 qualifiers) with an IF statement built referencing a cell with a drop-down of StateGroup selections where I also added “Total Population” as one of the selections in the drop-down.
=IF($F$8="Total Population",IFERROR(GETPIVOTDATA("ItemNum",PivotSt ateTotal!$B$5,"CurFlag",$C24,"EventCd",$B24,"Month Year",AH$4), 0),IFERROR(GETPIVOTDATA("ItemNum",PivotStateTotal! $B$5,"CurFlag",$C24,"EventCd",$B24,"MonthYear",AH$ 4,"StateGroup",$F$8), 0))
It’s because I’m either showing the summary OR one of the StateGroup selections, not all at the same time with a sum at the bottom. This thing has been changing so much, it’s important for me to have the same formula throughout the entire sheet and no references to other sheets (except for the ones the pivots are on).