Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
74 | |
68 | |
51 | |
30 |
User | Count |
---|---|
115 | |
109 | |
71 | |
65 | |
39 |