title: DAX calculate previous value also when it doesn't exist
body: <p>I have data that collects "snapshots" of a Warehouse.
  It has three columns:
  <em>SnapshotDate</em>, <em>Item</em>, <em>OnHand</em> </p>
  
  <p>(Real data has nearly 100.000 records for each <em>SnapshotDate</em>, here I post an example)</p>
  
  <p><a href="https://i.stack.imgur.com/vlYvd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vlYvd.png" alt="enter image description here"></a></p>
  
  <p>I want to measure the <strong><em>Delta OnHand</em></strong> with respect to the previuos Date (whatever it is).</p>
  
  <p>So I've set three calculated columns:</p>
  
  <p><strong>PreviousDate</strong></p>
  
  <pre><code>=
  var currentDate = Inventory[SnapshotDate]
  return CALCULATE( MAX( Inventory[SnapshotDate]); 
  FILTER( ALL(Inventory); Inventory[SnapshotDate] &lt; currentDate)
  )
  </code></pre>
  
  <p><strong>PreviousOnHand</strong></p>
  
  <pre><code>= LOOKUPVALUE(Inventory[OnHand]; Inventory[SnapshotDate]; Inventory[PreviousDate]; Inventory[Item]; Inventory[Item])+0
  </code></pre>
  
  <p><strong>OnHandDelta</strong></p>
  
  <pre><code>=Inventory[OnHand]-Inventory[PreviuosOnHand]
  </code></pre>
  
  <p><strong>Delta measure:</strong></p>
  
  <pre><code>Delta:=SUM(Inventory[OnHandDelta])
  </code></pre>
  
  <p>When I pivot this data, I'd like to see 0 (red bordered cell) when the data doesn't exist and more important I should see the Delta value -10 (cyan cell).</p>
  
  <p><a href="https://i.stack.imgur.com/fBC2g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fBC2g.png" alt="enter image description here"></a></p>
  
  <p>How could this be achieved?</p>
  
  <p><a href="https://drive.google.com/open?id=153EO_VU-PhekFzSuE6W6iwH2-xMJEfiW" rel="nofollow noreferrer">Link to the test Excel file</a></p>