Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 48 | |
| 38 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 85 | |
| 70 | |
| 38 | |
| 28 | |
| 25 |