Search This Blog

Displaying Pivot Table Column Sum outside Pivot Table

Displaying Pivot Table Column Sum outside Pivot Table 


I was working on a Excel Report where i have to display the Grand Total of pivot table field in the Header of Report also  i was having slicer (Report filter ) in the Report.
Testing  Pivot Table and Slicers examples are in my Previous post.

Creating Excel Pivot Table using SQL Database

http://sqlandssrssolutions.blogspot.in/2013/12/creating-excel-pivot-table-using-sql.html

Slicers to Filter data of Pivot Table in Excel


Using the same above Pivot table and slicers to demonstrate the Solution to Display Pivot Table Sum outside Pivot Table.

Mistake What i did earlier in the Header cell i called the GrandTotal cell thinking that it was simple just to display the total.

like in below Report  c11  is the cell where i was having GrandTotal 53000 and i have to display the total
Salary in the first riw i.e Header.(c1)


so what i did in formula bar of C1 i directly wrote =C11(c11 is the cell displaying Grand Total)

It was displaying total correct until i didn't applied  filtered to the Report when i filtered the Report using Slicer it was showing Zero as Total Salary,which was 13,000.below screenshot.



Then i used GetPivotData function to display pivot table field but it didn't worked with GrandTotal for me.

So Here is the trick which i did for Solution .

write the formula =Sum(c3:c11)/2

--c2 is the first cell of the column from where to start summing 
--c10 is the last cell which has GrandTotal of all Salary.

Now add any filter to the Report it will show the Exact sum.

Note:Must  Include Grand Total cell in the Sum formula as final Range.



No comments:

Post a Comment