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
CloudMonkey
Post Prodigy
Post Prodigy

Moving average formula error

Hi,

 

I have a simple formula that's meant to find the moving average for the number of weeks as selected from a slicer. My problem is that it is changing the scale on my x axis. When I select a 2 month moving average the x axis extends one week to the right, and when I select a 12 week moving average it extends the x asix 11 weeks to the right. Please can anyone explain why it's doing this and how to stop it?

 

Revenue (adjustable weeks moving average) = 
VAR
    MovingAverageEndWeek = max('Calendar - Days'[Calendar Date (week bins)])
VAR
    MovingAverageStartWeek = MovingAverageEndWeek - 7*(selectedvalue('Selected Integers'[Integars])-1)
RETURN
    CALCULATE([Revenue],
'Calendar - Days'[Calendar Date (week bins)] >= MovingAverageStartWeek &&
'Calendar - Days'[Calendar Date (week bins)] <= MovingAverageEndWeek)

 

Thanks,

 

CM 

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi @CloudMonkey ,

 

Sorry but I cant reproduce your scenario ,could you pls upload some screenshots to make it more clear?

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
 

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