title: How do I create a custom grand total or calculated field in my pivot table in Excel?
body: <p>I have a pivot table with various calculated fields. I want one of these calculated fields to change depending on what I choose from the slicer. In order to help understand what I'm trying to do I can provide some screenshots: </p>
  
  <p><a href="https://i.stack.imgur.com/6gPmD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6gPmD.png" alt="enter image description here"></a></p>
  
  <p>Here each row contains information for one SITA and each column is a calculated field. The Var(%) column is (ABS(OTB Occupancy - OFF Occupancy))/OTB Occupancy. The very last entry in Var(%) is calculated manually and takes the average of the column (this restricts me from filtering the pivot table as I'll have to recalculate the formula and/or move it to another cell so it stays in the position where it is the last cell).</p>
  
  <p>Now my problem is I am no longer using this pivot table but I am starting to create other pivot tables which need to be more dynamic than this one. For example:</p>
  
  <p><a href="https://i.stack.imgur.com/Q9pbR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q9pbR.png" alt="enter image description here"></a></p>
  
  <p>As you can see the first two entries of April in the pivot table correspond with the previous pivot table (OTB Occupancy and OFF Occupancy are the same as Sum of Act_Occ and Sum of Fct_Occ respectively). However, I need the third column to be the average given in the last entry of Var(%). (Please note that this cell isn't part of the pivot table and it's just a formula i used). But also, if I were to select two SITAs only from the slicer I'll want only the average of them two. </p>
  
  <p>I'm not sure if excel can do what I want but any help is appreciated. </p>