Forum Discussion
rschaudhr
5 years agoResolver II
Calculated Column sum last 60 days
Here is the data below:
| Date | Index | Data | Calculated column - Data_Index |
| 201801 | 1 | 100 | |
| 201802 | 2 | 200 | |
| 201803 | 3 | 50 | 350 |
| 201805 | 4 | 50 | 300 |
| 201806 | 5 | 400 | 500 |
| 201809 | 6 | 25 | 475 |
So I have the above table. I have date, index and data column. I want to create a calculated column with takes the values from index and data and add the last 3 day (including the current row). So for example, index 3, the calculated column would have 350 which is (50 [index 3] + 200[index 2] + 100[index 3]).
Is there any way to accomplish this?
Thank you
4 Replies
- Greg_DecklerCommunity Champion
rschaudhr So, maybe:
Column = VAR __Min = [Date]-60 RETURN SUMX(FILTER('Table',[Date]<=EARLIER([Date]) && [Date]>=__Min),[Date])- rschaudhrResolver II
Hi Thanks for the code. However, it is adding the dates not the data. I will see if I can modify it.
- amitchandakSuper User
rschaudhr , a new column like
sumx(filter(Table, [index] <=earlier([index]) && [index] >=earlier([index])-2),[Data])
- rschaudhrResolver II