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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Sveina
Frequent Visitor

Rolling average on quarterly data

Hi,

 

I am trying to calcualte a rolling average (or moving avergae) based on some quarterly data. I do not have days and dates, only sum for each quarter. The data table looks like this:

 

Quarter

Quantity

Q1 2016

   18650

Q2 2016

   18565

Q3 2016

   18262

Q4 2016

   18453

Q1 2017

   18283

Q2 2017

   18260

Q3 2017

   18086

Q4 2017

   18127

Q1 2018

   18363

Q2 2018

   18374

Q3 2018

   18261

Q4 2018

   18307

Q1 2019

   18473

Q2 2019

   18573

Q3 2019

   18429

Q4 2019

   18577

Q1 2020

   18763

Q2 2020

   18641

Q3 2020

   18276

Q4 2020

   18370


What I am trying to accomplish is this; 

Uten navn-2.jpg

 

That is, I am trying to calculate a 4-quarter moving / rolling average. The calculations are not hard, and I have shown examples for the two first values in the table above.

 

If anyone could offer som advice I would really appreciate it.

Thanks so much in advance.

 

Regards

Svein

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Sveina ,

 

If you don't have date column then you will need an index column.

2.PNG

And then create a column as below.

Column = IF('Table'[Index]>3,CALCULATE(SUM('Table'[Quantity]),FILTER('Table','Table'[Index]>=EARLIER('Table'[Index])-3&&'Table'[Index]<=EARLIER('Table'[Index])))/4,BLANK())

3.PNG

 

Best Regards,

Jay

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

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Sveina ,

 

If you don't have date column then you will need an index column.

2.PNG

And then create a column as below.

Column = IF('Table'[Index]>3,CALCULATE(SUM('Table'[Quantity]),FILTER('Table','Table'[Index]>=EARLIER('Table'[Index])-3&&'Table'[Index]<=EARLIER('Table'[Index])))/4,BLANK())

3.PNG

 

Best Regards,

Jay

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

Hi Jay,

 

Your solution worked absolutely great 👍😁

Thanks you so much for your time and effort, really appreciate it!!!!

 

Best Regards

Svein

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.