title: How to find day over day change in summarize table taking two columns into account
body: <p>I have a summarize table that is summed by the Date and Building_Name. I am trying to figure out how to add an increase/ decrease column like my table below. I want to show if the 'total unsigned' has increased from day to day for each building.</p>
  
  <p>I cannot get a formula that will take the previous days total for one building - current days # of total unsigned. Trying to get the forth column for my report. </p>
  
  <p>I can get it to work if I am just showing day over day change if I am not also trying to add the Building_name to the table.</p>
  
  <pre><code>Unsigned Prev Day = 
  VAR CurrentDay = SELECTEDVALUE(SummarizeTable[Day Number]) 
  VAR CurrentMonth = SELECTEDVALUE(SummarizeTable[Month Number]) 
  VAR MaxDayNumber = CALCULATE(MAXA(SummarizeTable[Day Number])) 
  
  Return SUMX(
      FILTER(ALL(SummarizeTable),
           IF( CurrentDay = 1, 
            SummarizeTable[Day Number] = MaxDayNumber &amp;&amp; SummarizeTable[Month Number]= CurrentMonth-1,
            SummarizeTable[Day Number] = CurrentDay -1)),
              [Total Unsigned])
  </code></pre>
  
  <p>Edit:
  Thank you for the help, you definitely put me on the right track. This is the formula I ended up using. Thank you again for the help! <img src="https://i.stack.imgur.com/umY2U.png" alt="Final formula"></p>