Forum Discussion
Anonymous
7 years agoNot applicable
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
| Date | Dealer | Count | Delta (need this column) |
| 4/1/2019 | A | 1 | |
| 4/2/2019 | A | 4 | 3 |
| 4/3/2019 | A | 9 | 5 |
| 4/1/2019 | B | 10 | |
| 4/2/2019 | B | 15 | 5 |
| 4/3/2019 | B | 20 | 5 |
| 4/1/2019 | C | 7 | |
| 4/2/2019 | C | 10 | 3 |
| 4/3/2019 | C | 12 | 2 |
!
2 Replies
- TeigeGao
Solution 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
- AnonymousNot applicable
I was not very clear. I updated my original post. I do apologize. I have one table that gets new entries each day.
Date Dealer Count Delta 4/1/2019 A 1 4/2/2019 A 4 3 4/3/2019 A 9 5 The delta column is what I am after.