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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
owlet0214
Helper I
Helper I

Moving Average

Hello, 

 

I made a moving average with reference to "https://community.powerbi.com/t5/Desktop/Moving-Average/m-p/43041", but I can't.

I tried other methods, but I couldn't, so I'll consult you.

 

moving_average2.PNG

 

My DAX is below.

The table above shows the "fixday" hierarchy.

 

MovingAverage7day2 =
CALCULATE (
AVERAGEX ( 'Table', 'Table'[count] ),
DATESINPERIOD (
'Table'[fixday],
LASTDATE ('Table'[fixday] ),
-7,
day
)

)

 

When I tried with the following formula, only the specified period part was displayed,

but it seems that "SUM" does not work, and "count / 7" are lined up.

 

I don't think that the above formula and the formula below work for the function that aggregates the filtered periods.

 

CALCULATE(
SUM('Table'[count])/7,
FILTER('Table','Table'[count] < DATE(2020,05,16) && 'Table'[count] > DATE(2020,05,10)))
)

 

I need help.

3 REPLIES 3
amitchandak
Super User
Super User

@owlet0214 , Join you date with date calendar and try. I assumed that fixday is a date

 

Rolling 7 = CALCULATE(Average('Table'[count]),DATESINPERIOD(Date[Date],MAX('Table'[fixday]),-7,Day))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you, I have a meeting so I'll try it later.

Thank you very much. I was able to count well.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.