Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Morning,
I could have sworn I have used this before and for some reason now it isn't working.
I'm attempting to calculate the sum of sessions of the past seven days on a rolling basis. I have a date table, with a relationship to the date of the table containing the number of sessions per day and date.
Formula used;
SumpastweekSessions = CALCULATE(Sum('NumberofSessions'[Sessions]), DATEADD('NumberofSessionsDateTable'[DateKey], -7,DAY))The answer should be 30; but instead I'm recieving 2734.
When I change the number of the interval the value changes; I feel I'm missing something here.
Solved! Go to Solution.
I solved it lads, no clue what I'm feeling on this one. I'd love an explanation but I feel I just misinterpreted what DATEADD does a long time ago and I just haven't noticed I've been calculating the wrong values.
Code I ended up using;
SumpastweekSessions = CALCULATE(Sum('NumberofSessions'[Sessions]), DATESINPERIOD('NumberofSessionsDateTable'[DateKey],TODAY(),-7,DAy)) I tried datesbetween as well.
I solved it lads, no clue what I'm feeling on this one. I'd love an explanation but I feel I just misinterpreted what DATEADD does a long time ago and I just haven't noticed I've been calculating the wrong values.
Code I ended up using;
SumpastweekSessions = CALCULATE(Sum('NumberofSessions'[Sessions]), DATESINPERIOD('NumberofSessionsDateTable'[DateKey],TODAY(),-7,DAy)) I tried datesbetween as well.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 48 | |
| 35 | |
| 31 | |
| 27 |