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
Hello all,
I'm trying to calculate a rolling sum over a 5 day time period and store that sum for each date in my table. I've created a sample data set that shows the relevant calculations in excel. I have tried to implement a rolling total using multiple online sources, but nothing seems to work. I have successfully created the 'All Lots [lbs]' column to total the smaller values, but cannot figure out the rolling sum. Due to other calculation constraints, I must do this calculation with DAX, not PowerQuery M. I would greatly appreciate any help!
(*) is used here as a placeholder, nothing more.
Solved! Go to Solution.
Hi @Anonymous ,
I have created a simple sample, please refer to it to see if it helps you.
Create 2 columns.
all lots = 'Table'[Lot 1]+'Table'[Lot 2]+'Table'[Lot 3]
5 day rolling total =
VAR _5day = 'Table'[date] + 4
RETURN
CALCULATE (
SUM ( 'Table'[all lots] ),
FILTER (
ALL ( 'Table' ),
'Table'[date] <= _5day
&& 'Table'[date] >= EARLIER ( 'Table'[date] )
)
)
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I have created a simple sample, please refer to it to see if it helps you.
Create 2 columns.
all lots = 'Table'[Lot 1]+'Table'[Lot 2]+'Table'[Lot 3]
5 day rolling total =
VAR _5day = 'Table'[date] + 4
RETURN
CALCULATE (
SUM ( 'Table'[all lots] ),
FILTER (
ALL ( 'Table' ),
'Table'[date] <= _5day
&& 'Table'[date] >= EARLIER ( 'Table'[date] )
)
)
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Works like a charm, thank you for your help!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 20 | |
| 12 | |
| 12 |