Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I got the data as below: Column A and B are the raw data, Column C (EWMA) is calculated in Excel, the formula is :
EWMAn =Current Weekly Amount *0.2+ previous EWMA*0.8, while EWMA0 (first row) = current amount*0.2+average all weekly amount*0.8
Any way to calculate using DAX in Power BI as the formula need to refer to the previous row in the same column.
Thanks in Advance
Lijie
Week/c | Weekly Amount | EWMA | Calculation |
01/01/2018 | 105,000 | 114,758 | b2*0.2+Average (b2:b63)*0.8 |
08/01/2018 | 108,000 | 113,406 | B3*0.2+D2*0.8 |
15/01/2018 | 97,770 | 110,279 | B4*0.2+D3*0.8 |
22/01/2018 | 89,000 | 106,023 | B5*0.2+D4*0.8 |
29/01/2018 | 86,156 | 102,050 | |
05/02/2018 | 83,746 | 98,389 | |
12/02/2018 | 83,000 | 95,311 | |
19/02/2018 | 85,000 | 93,249 | |
26/02/2018 | 76,000 | 89,799 | |
05/03/2018 | 90,000 | 89,839 | |
12/03/2018 | 90,720 | 90,015 | |
19/03/2018 | 89,000 | 89,812 | |
26/03/2018 | 66,000 | 85,050 | |
02/04/2018 | 92,100 | 86,460 | |
09/04/2018 | 90,000 | 87,168 | |
16/04/2018 | 87,000 | 87,134 | |
23/04/2018 | 97,000 | 89,107 | |
30/04/2018 | 85,000 | 88,286 | |
07/05/2018 | 91,000 | 88,829 | |
14/05/2018 | 68,000 | 84,663 | |
21/05/2018 | 71,026 | 81,936 | |
28/05/2018 | 87,739 | 83,096 | |
04/06/2018 | 96,000 | 85,677 | |
11/06/2018 | 86,361 | 85,814 | |
18/06/2018 | 78,256 | 84,302 | |
25/06/2018 | 91,052 | 85,652 | |
02/07/2018 | 99,000 | 88,322 | |
09/07/2018 | 91,550 | 88,967 | |
16/07/2018 | 100,100 | 91,194 | |
23/07/2018 | 94,000 | 91,755 | |
30/07/2018 | 99,836 | 93,371 | |
06/08/2018 | 109,484 | 96,594 | |
13/08/2018 | 107,846 | 98,844 | |
20/08/2018 | 107,482 | 100,572 | |
27/08/2018 | 97,250 | 99,907 |
Hi @LijieWang ,
Nope, you can't use dax formula to do recursive calculation in power bi.
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |