Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Help with calculate column

I have a table of data that is a list of lets say dealers. Dealer a, dealer b, dealer c. and a count column. Each day i get new records with new month to day totals.

 

I want to create a new column that is a daily count, a delta, a calculation that is todays count minus previous days count, for each row (row context?).Each day my data is refreshed with MTD figures. 

Thank you

DateDealerCountDelta (need this column)
4/1/2019A1 
4/2/2019A43
4/3/2019A95
4/1/2019B10 
4/2/2019B155
4/3/2019B205
4/1/2019C7 
4/2/2019C103
4/3/2019C122

!

2 Replies

  • TeigeGao's avatar
    TeigeGao
    Icon for Solution Sage rankSolution Sage

    Hi Anonymous ,

    We can use the following DAX query to create a calculated column:

    Today's count = 'day 2'[Count] - LOOKUPVALUE(day1[Count],day1[Dealer],'day 2'[Dealer])

    The result will like below:

    Best Regards,

    Teige

    • Anonymous's avatar
      Anonymous
      Not applicable

      I was not very clear. I updated my original post. I do apologize. I have one table that gets new entries each day. 

      DateDealerCountDelta
      4/1/2019A1 
      4/2/2019A43
      4/3/2019A95

      The delta column is what I am after.