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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Friso
Frequent Visitor

Moving Average

Hello, 

 

To calculate the Moving Average Total of different WEEKS i need a liitle bit help. For example I have the results of three years and each week give a result.. I have made a INDEZ table and each combination of a Year - Week has his own number. For example 2016 week 1 = 1, 2016 week 2 = 2, but 2017 week 1 = 53, etc......Is is possible to calculate the MAT using this Indexnumer? 

 

For example in this week (2018 Week 13 = Index number 117)  I will calculate the results from Index number 67 til 117 (total 52 weeks...) 

 

Who can help me? 

Friso

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Friso,

 

Suppose there existing a relationship between data table and INDEZ table based on Year-Week column. Please try to add calculated columns to your data table.

Index No = RELATED(INDEZ[Index])

Moving Average = CALCULATE(AVERAGE(Test1[Sales]),FILTER(Test1,Test1[Index No]<=EARLIER(Test1[Index No])&&Test1[Index No]>=(EARLIER(Test1[Index No])-50)))

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Friso,

 

Suppose there existing a relationship between data table and INDEZ table based on Year-Week column. Please try to add calculated columns to your data table.

Index No = RELATED(INDEZ[Index])

Moving Average = CALCULATE(AVERAGE(Test1[Sales]),FILTER(Test1,Test1[Index No]<=EARLIER(Test1[Index No])&&Test1[Index No]>=(EARLIER(Test1[Index No])-50)))

Best regards,

Yuliana Gu

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.