title: How to add calculated column to a pivot table connected to SSAS tabular model?
body: <p>Or in another words the question is - how to add some calculation in the pivot table based on columns which do not exist in model level.</p>
  
  <p>I've reproduced my problem using <strong>AdventureWorksDW2014</strong> sample database.</p>
  
  <p>Let's say I want to calculate difference between Actual and Budget scenario amounts in the <strong>FactFinance</strong> table for each Organisation and present it in a form of pivot table.</p>
  
  <p><a href="https://i.stack.imgur.com/Mx1D1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mx1D1.png" alt="tabular model"></a></p>
  
  <p>To achieve that I've created a simple model (screen above) and added <strong>SumOfAmount</strong> measure to the <strong>FactFinance</strong> table <code>SumOfAmount:=SUM([Amount])</code></p>
  
  <p>Next, I've opened my model in Excel and created very simple pivot table (shown below)</p>
  
  <p><a href="https://i.stack.imgur.com/d9Ecu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d9Ecu.png" alt="pivot field ist"></a>
  <a href="https://i.stack.imgur.com/3vsyb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3vsyb.png" alt="pivot in excel"></a></p>
  
  <p>So, (the question part) now I want to add an extra column to my pivot table, which should calculate something (for example difference) between columns <strong>Actual</strong> and <strong>Budget</strong>. And I want this new column been a part of the pivot table so I could filter it or\and add new grouping levels without necessity to change something "outside" the pivot table.</p>
  
  <hr>
  
  <p><strong>TRIED SO FAR</strong></p>
  
  <p>I tried to add <strong>Calculated Field</strong> but it seems like I can only use "real" columns for calculations. Columns which appeared in a pivot table based on values from COLUMNS quadrant can't be used as sources for calculations. </p>
  
  <p><a href="https://i.stack.imgur.com/2D2oq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2D2oq.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p><strong>FINAL SOLUTION</strong></p>
  
  <p>I got it finally combined two pivot tables: the old one and the one with <code>Diff</code> measure, defined as <code>Diff:=[Actual Amount]-[Budget Amount]</code>, where</p>
  
  <pre><code>Actual Amount:=Calculate([SumOfAmount];'DimScenario'[ScenarioName] = "Actual")
  Budget Amount:=Calculate([SumOfAmount];'DimScenario'[ScenarioName] = "Budget")
  </code></pre>
  
  <p>as @WimV suggested
  <a href="https://i.stack.imgur.com/5TBzs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5TBzs.png" alt="enter image description here"></a></p>