Forum Discussion
mpbi
4 years agoNew Member
Exponential Weighted Moving Average DAX
Hello, I am new to DAX and trying to calculate Exponential Weighted Moving Average for one of my report.
Please find below attached data element and expected result which I have calculated manually into excel and would like to replicate same logic to DAX so I can utilize into my Power BI report.
For very first month from selection it should use mean value for calculation as shown in below table and for all upcoming months calculated result value from previous month would be used instead of mean.
| Row Labels(A) | Percent Meeting(B) | Count | Sum | Mean(F) | Par1(G) | Par2(H) | Result(I) | Formula | |
| 7/1/2017 | 0.52303989 | 9 | 4.215079105 | 0.46834 | 0.2 | 0.8 | 0.479281676 | (G2*B2)+(H2*F2) | |
| 8/1/2017 | 0.453555986 | 0.2 | 0.8 | 0.474136538 | (G3*B3)+(H3*I2) | ||||
| 9/1/2017 | 0.442665891 | 0.2 | 0.8 | 0.467842409 | (G4*B4)+(H4*I3) | ||||
| 10/1/2017 | 0 | 0.2 | 0.8 | 0.374273927 | (G5*B5)+(H5*I4) | ||||
| 11/1/2017 | 0.75 | 0.2 | 0.8 | 0.449419142 | (G6*B6)+(H6*I5) | ||||
| 12/1/2017 | 0 | 0.2 | 0.8 | 0.359535313 | (G7*B7)+(H7*I6) | ||||
| 1/1/2018 | 0.411053307 | 0.2 | 0.8 | 0.369838912 | (G8*B8)+(H8*I7) | ||||
| 2/1/2018 | 0.914832191 | 0.2 | 0.8 | 0.478837568 | (G9*B9)+(H9*I8) | ||||
| 3/1/2018 | 0.719931841 | 0.2 | 0.8 | 0.527056422 | (G10*B10)+(H10*I9) |
1 Reply
- AlexisOlson
Super User
My comment on this blog post may be useful to you:
https://community.powerbi.com/t5/Community-Blog/Exponential-Moving-Average-in-Power-Query-EMA/ba-p/1912085