Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ddetzler
New Member

Need help using a slicer/filter on a calculated rolling sum column

I have been stumped for days on this one. Please help. Below is an example of the table I am working from.

 

I am needing to create a rolling 7 day average of sales, and plot that on a graph. <-- This part I have been able to do with the below Columns:

 

Sales Rolling 7 Day =
CALCULATE (
SUM (Daily[Sales (Daily)]),
DATESINPERIOD ( 'Daily'[Date], LASTDATE ( 'Daily'[Date] ), -7, DAY ),
ALLEXCEPT ( Daily, Daily[Sales (Daily)]) )
)

 

THEN:

 

Avg. Sales Rolling 7 Day = [Sales Rolling 7 Day]/7

 

 

This part works, and I am able to look at total sales at a rolling 7 day avg. view. The problem occurs when I try to add a slicer to the page (Product_ID). When I try to filter the graph by product_ID, it does not show rolling 7 avg. for just that Product_ID, it continues to show the total. Any help would be appreciated. Thanks!

 

 

Capture.PNG

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @ddetzler,

 

Please modify your formula like below.

 

Sales Rolling 7 Day =
CALCULATE (
    SUM ( 'Daily'[Sales] ),
    DATESINPERIOD ( 'Daily'[Date], LASTDATE ( 'Daily'[Date] ), -7, DAY ),
    VALUES ( Daily[Product_ID] )
)

Then you could get your desired output.

 

Untitled.png

 

Hope this can help you!

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @ddetzler,

 

Please modify your formula like below.

 

Sales Rolling 7 Day =
CALCULATE (
    SUM ( 'Daily'[Sales] ),
    DATESINPERIOD ( 'Daily'[Date], LASTDATE ( 'Daily'[Date] ), -7, DAY ),
    VALUES ( Daily[Product_ID] )
)

Then you could get your desired output.

 

Untitled.png

 

Hope this can help you!

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That did it! Thank you @v-piga-msft!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors