Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am trying to have a running total for the last 7 days. My table currently have Date and Value. I inserted a calculate column that I want to calculate the results for the previous 7 days. Since my table starts at 1/1 there will naturally be less than 7 days for the first 6 days of the year. However, beyond that I want to calculate the previous 7 day total based on only dates that fall in that range. So 1/7 would be all the values for 1/1 through 1/7 and 1/8 would be all the values for 1/2 through 1/8 and continuing on for the entire year. How can I accomplish this in DAX?
Date Value Running 7 Day
1/1 2 2
1/2 3 5
1/3 1 6
1/4 4 10
1/5 2 12
1/6 3 15
1/7 1 16
1/8 4 18
1/9 3 18
Solved! Go to Solution.
Use this MEASURE
7 Day RT MEASURE = CALCULATE ( SUM ( Table1[Value] ), DATESINPERIOD ( Table1[Date], LASTDATE ( Table1[Date] ), -7, DAY ) )
Use this MEASURE
7 Day RT MEASURE = CALCULATE ( SUM ( Table1[Value] ), DATESINPERIOD ( Table1[Date], LASTDATE ( Table1[Date] ), -7, DAY ) )
User | Count |
---|---|
94 | |
78 | |
73 | |
63 | |
60 |
User | Count |
---|---|
108 | |
101 | |
77 | |
63 | |
61 |