Broken refresh, a misleading calculated field and slicers that only move one table
A distribution company keeps 250,000 invoice lines on a sheet named Raw, in the plain range A1:M250001. Four PivotTables and one dashboard sheet read from it. Three failures appeared in the same week. First, 4,000 invoices pasted immediately below row 250001 never appeared after Refresh. Second, dashboard cells built with GETPIVOTDATA began returning #REF! after someone switched a PivotTable from Compact to Tabular form and renamed a field from "Salesperson" to "Rep". Third, a calculated field named Avg Deal Size reports 41,000 while the true average invoice value in the source is 1,730; the field is defined as =Revenue/Deals. Two slicers on the dashboard were meant to filter everything, but they only move one PivotTable. The workbook is refreshed by three different analysts on Friday afternoons, and the finance director wants the dashboard to be correct the moment it is opened on Monday.
1. Why does Refresh ignore the 4,000 new invoices, and what would you change so the file stays current without manual address edits?
Read the worked answer
Cause. The pivot cache stores a hard address, Raw!$A$1:$M$250001. Refresh re-reads exactly that rectangle and never looks below it, so the new invoices are outside the source and invisible no matter how often someone clicks Refresh.
Options, best first:
- Convert the source to an Excel Table (Ctrl+T, name it
tblInvoices) and set PivotTable Analyze > Change Data Source totblInvoices. Rows pasted immediately beneath the table join it on paste, so Refresh includes them with no address to maintain. This is the durable fix for a monthly-growing file. - Change Data Source each month to the new last row. It works, but it is a manual step that three different analysts will eventually forget.
- A dynamic defined name as the source also works, but it is harder for the next analyst to audit than a named table.
Also set PivotTable Options > Data > Refresh data when opening the file, which is what makes Monday's view correct. Warn the team that a full refresh over 250,000 rows takes time, and that on a shared drive two people refreshing simultaneously will fight over the same file; a copy each is safer than a shared live workbook.
2. The calculated field shows 41,000 against a true average of 1,730. Explain the mechanism and give the correct construction.
Read the worked answer
Mechanism. A calculated field is not evaluated row by row. Excel first aggregates each underlying field across the cell's scope - Sum of Revenue, Sum of Deals - and only then applies the formula to those totals. =Revenue/Deals therefore computes total revenue divided by total deal count, a weighted figure dominated by the largest invoices. On skewed data that lands at 41,000 while the mean invoice is 1,730. The same trap makes any "average of a percentage" calculated field meaningless, because it becomes a ratio of sums.
Correct constructions:
- Add a column to the source -
=Revenue/Dealsper row - then place that field in Values with the aggregation set to Average. That averages the row-level metric, which is what finance actually means. It also inherits any new rows if the source is a table. - If the question is simply average revenue per deal, drag Revenue to Values twice: one instance Sum, one instance Average. No calculated field is needed.
- In Power Pivot, write a true measure, and note that
SUM([Revenue])/SUM([Deals])is still a ratio of sums;AVERAGEXis the row-level equivalent.
Test before shipping: reconcile against =AVERAGEIFS(Revenue, ...) over the source for one region and one month.
3. GETPIVOTDATA started returning #REF! and the slicers control only one PivotTable. Explain both and describe how to make the dashboard resilient.
Read the worked answer
The #REF! cause. GETPIVOTDATA stores field and item names as text at the moment the formula is generated, for example =GETPIVOTDATA("Sum of Sales",$A$3,"Salesperson","North"). Renaming the field to Rep, or removing it from the pivot, invalidates that name and the formula errors. A layout change from Compact to Tabular is normally harmless on its own; the rename is the culprit, which is why the two events looked like one.
Making it resilient:
- Treat field names as part of the interface and keep them stable; if a rename is unavoidable, Find & Replace
"Salesperson"across the dashboard sheet. - Drive the criteria from cells -
=GETPIVOTDATA("Sum of Sales",$A$3,"Rep",$B$1)- so a picker selects the item rather than a hard-coded string. - If reference-safety is not needed, turn off PivotTable Analyze > Options > Generate GetPivotData and use direct cell references; shorter, but they break on sort and layout changes.
Slicers. One slicer filters one PivotTable by default. Right-click the slicer > Report Connections and tick all four. They only appear in that list if they share the same pivot cache, meaning the same source range; if one PivotTable was built from an older range it will be missing, and the fix is to rebuild it from the shared source rather than to add a second slicer. Recheck Report Connections after any Change Data Source.