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

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.

Reply
LijieWang
Regular Visitor

Help- Dax measure to calculate Exponential weighted moving average (EWMA)

I got the data as below: Column A and B are the raw data, Column C (EWMA) is calculated in Excel, the formula is : 

EWMA=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/cWeekly AmountEWMACalculation
01/01/2018105,000114,758b2*0.2+Average (b2:b63)*0.8
08/01/2018108,000113,406B3*0.2+D2*0.8
15/01/201897,770110,279B4*0.2+D3*0.8
22/01/201889,000106,023B5*0.2+D4*0.8
29/01/201886,156102,050 
05/02/201883,74698,389 
12/02/201883,00095,311 
19/02/201885,00093,249 
26/02/201876,00089,799 
05/03/201890,00089,839 
12/03/201890,72090,015 
19/03/201889,00089,812 
26/03/201866,00085,050 
02/04/201892,10086,460 
09/04/201890,00087,168 
16/04/201887,00087,134 
23/04/201897,00089,107 
30/04/201885,00088,286 
07/05/201891,00088,829 
14/05/201868,00084,663 
21/05/201871,02681,936 
28/05/201887,73983,096 
04/06/201896,00085,677 
11/06/201886,36185,814 
18/06/201878,25684,302 
25/06/201891,05285,652 
02/07/201899,00088,322 
09/07/201891,55088,967 
16/07/2018100,10091,194 
23/07/201894,00091,755 
30/07/201899,83693,371 
06/08/2018109,48496,594 
13/08/2018107,84698,844 
20/08/2018107,482100,572 
27/08/201897,25099,907 

 

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @LijieWang ,

Nope, you can't use dax formula to do recursive calculation in power bi.

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.