Forum Discussion
vdomingueza
9 years agoNew 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 :
| Dia | Valor | TAM |
| 01/10/2016 | 638 | |
| 02/10/2016 | 827 | |
| 03/10/2016 | 771 | |
| 04/10/2016 | 359 | 648,75 |
| 05/10/2016 | 271 | 557 |
| 06/10/2016 | 147 | 387 |
| 07/10/2016 | 812 | 397,25 |
| 08/10/2016 | 749 | 494,75 |
| 09/10/2016 | 599 | 576,75 |
| 10/10/2016 | 254 | 603,5 |
| 11/10/2016 | 848 | 612,5 |
| 12/10/2016 | 164 | 466,25 |
| 13/10/2016 | 515 | 445,25 |
| 14/10/2016 | 529 | 514 |
| 15/10/2016 | 702 | 477,5 |
| 16/10/2016 | 216 | 490,5 |
| 17/10/2016 | 722 | 542,25 |
| 18/10/2016 | 988 | 657 |
| 19/10/2016 | 342 | 567 |
| 20/10/2016 | 188 | 560 |
| 21/10/2016 | 494 | 503 |
| 22/10/2016 | 673 | 424,25 |
| 23/10/2016 | 363 | 429,5 |
| 24/10/2016 | 124 | 413,5 |
| 25/10/2016 | 898 | 514,5 |
| 26/10/2016 | 510 | 473,75 |
| 27/10/2016 | 116 | 412 |
| 28/10/2016 | 993 | 629,25 |
| 29/10/2016 | 112 | 432,75 |
| 30/10/2016 | 578 | 449,75 |
| 31/10/2016 | 500 | 545,75 |
| 01/11/2016 | 627 | 454,25 |
| 02/11/2016 | 500 | 551,25 |
| 03/11/2016 | 288 | 478,75 |
| 04/11/2016 | 471 | 471,5 |
| 05/11/2016 | 613 | 468 |
| 06/11/2016 | 844 | 554 |
| 07/11/2016 | 190 | 529,5 |
| 08/11/2016 | 606 | 563,25 |
| 09/11/2016 | 444 | 521 |
| 10/11/2016 | 429 | 417,25 |
| 11/11/2016 | 147 | 406,5 |
| 12/11/2016 | 370 | 347,5 |
| 13/11/2016 | 193 | 284,75 |
| 14/11/2016 | 353 | 265,75 |
| 15/11/2016 | 859 | 443,75 |
| 16/11/2016 | 582 | 496,75 |
| 17/11/2016 | 107 | 475,25 |
| 18/11/2016 | 824 | 593 |
| 19/11/2016 | 107 | 405 |
| 20/11/2016 | 979 | 504,25 |
| 21/11/2016 | 389 | 574,75 |
| 22/11/2016 | 260 | 433,75 |
Do you have any idea how to do in Power BI?
Thanks in advance.
Kind Regards,
2 Replies
- vdominguezaNew 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 :
Dia Valor TAM 01/10/2016 638 02/10/2016 827 03/10/2016 771 04/10/2016 359 648,75 05/10/2016 271 557 06/10/2016 147 387 07/10/2016 812 397,25 08/10/2016 749 494,75 09/10/2016 599 576,75 10/10/2016 254 603,5 11/10/2016 848 612,5 12/10/2016 164 466,25 13/10/2016 515 445,25 14/10/2016 529 514 15/10/2016 702 477,5 16/10/2016 216 490,5 17/10/2016 722 542,25 18/10/2016 988 657 19/10/2016 342 567 20/10/2016 188 560 21/10/2016 494 503 22/10/2016 673 424,25 23/10/2016 363 429,5 24/10/2016 124 413,5 25/10/2016 898 514,5 26/10/2016 510 473,75 27/10/2016 116 412 28/10/2016 993 629,25 29/10/2016 112 432,75 30/10/2016 578 449,75 31/10/2016 500 545,75 01/11/2016 627 454,25 02/11/2016 500 551,25 03/11/2016 288 478,75 04/11/2016 471 471,5 05/11/2016 613 468 06/11/2016 844 554 07/11/2016 190 529,5 08/11/2016 606 563,25 09/11/2016 444 521 10/11/2016 429 417,25 11/11/2016 147 406,5 12/11/2016 370 347,5 13/11/2016 193 284,75 14/11/2016 353 265,75 15/11/2016 859 443,75 16/11/2016 582 496,75 17/11/2016 107 475,25 18/11/2016 824 593 19/11/2016 107 405 20/11/2016 979 504,25 21/11/2016 389 574,75 22/11/2016 260 433,75 Do you have any idea how to do in Power BI? Thanks in advance. Kind Regards,
- vanessafvgCommunity Champion
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