Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
@rschaudhr , a new column like
sumx(filter(Table, [index] <=earlier([index]) && [index] >=earlier([index])-2),[Data])
@rschaudhr So, maybe:
Column =
VAR __Min = [Date]-60
RETURN
SUMX(FILTER('Table',[Date]<=EARLIER([Date]) && [Date]>=__Min),[Date])
Hi Thanks for the code. However, it is adding the dates not the data. I will see if I can modify it.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |