cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
vdomingueza
New Member

Moving Average on weeks

Hi everyone, 

 

I'm trying to calculate moving average on 4 weeks like an Excel formula. The excel formula is calculated as a TAM(Moving Average) in Excel . 

 

The dates are the following : 

 

DiaValor TAM
01/10/2016638 
02/10/2016827 
03/10/2016771 
04/10/2016359648,75
05/10/2016271557
06/10/2016147387
07/10/2016812397,25
08/10/2016749494,75
09/10/2016599576,75
10/10/2016254603,5
11/10/2016848612,5
12/10/2016164466,25
13/10/2016515445,25
14/10/2016529514
15/10/2016702477,5
16/10/2016216490,5
17/10/2016722542,25
18/10/2016988657
19/10/2016342567
20/10/2016188560
21/10/2016494503
22/10/2016673424,25
23/10/2016363429,5
24/10/2016124413,5
25/10/2016898514,5
26/10/2016510473,75
27/10/2016116412
28/10/2016993629,25
29/10/2016112432,75
30/10/2016578449,75
31/10/2016500545,75
01/11/2016627454,25
02/11/2016500551,25
03/11/2016288478,75
04/11/2016471471,5
05/11/2016613468
06/11/2016844554
07/11/2016190529,5
08/11/2016606563,25
09/11/2016444521
10/11/2016429417,25
11/11/2016147406,5
12/11/2016370347,5
13/11/2016193284,75
14/11/2016353265,75
15/11/2016859443,75
16/11/2016582496,75
17/11/2016107475,25
18/11/2016824593
19/11/2016107405
20/11/2016979504,25
21/11/2016389574,75
22/11/2016260433,75

 

Do you have any idea how to do in Power BI?

 

Thanks in advance. 

 

Kind Regards, 

2 REPLIES 2
vanessafvg
Super User
Super User

create a measure

 

 

Moving_Average_4_weeks = 
CALCULATE (
    AVERAGEX ( 'table', 'table'[valor] ),
    DATESINPERIOD (
        'table'[date]
        LASTDATE ( 'table'[date] ),
        -4,
        week
    )
)

give this a bash @vdomingueza 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




vdomingueza
New Member

Hi everyone, I'm trying to calculate moving average on 4 weeks like an Excel formula. The excel formula is calculated as a TAM(Moving Average) in Excel . The dates are the following :

 

DiaValor TAM
01/10/2016638 
02/10/2016827 
03/10/2016771 
04/10/2016359648,75
05/10/2016271557
06/10/2016147387
07/10/2016812397,25
08/10/2016749494,75
09/10/2016599576,75
10/10/2016254603,5
11/10/2016848612,5
12/10/2016164466,25
13/10/2016515445,25
14/10/2016529514
15/10/2016702477,5
16/10/2016216490,5
17/10/2016722542,25
18/10/2016988657
19/10/2016342567
20/10/2016188560
21/10/2016494503
22/10/2016673424,25
23/10/2016363429,5
24/10/2016124413,5
25/10/2016898514,5
26/10/2016510473,75
27/10/2016116412
28/10/2016993629,25
29/10/2016112432,75
30/10/2016578449,75
31/10/2016500545,75
01/11/2016627454,25
02/11/2016500551,25
03/11/2016288478,75
04/11/2016471471,5
05/11/2016613468
06/11/2016844554
07/11/2016190529,5
08/11/2016606563,25
09/11/2016444521
10/11/2016429417,25
11/11/2016147406,5
12/11/2016370347,5
13/11/2016193284,75
14/11/2016353265,75
15/11/2016859443,75
16/11/2016582496,75
17/11/2016107475,25
18/11/2016824593
19/11/2016107405
20/11/2016979504,25
21/11/2016389574,75
22/11/2016260433,75

 

 

 Do you have any idea how to do in Power BI? Thanks in advance. Kind Regards,

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors