Forum Discussion
gianma78
2 years agoFrequent Visitor
Help with Weighted Moving Average for delay delivery
Dear Community, hope you can assist. I am struggling with finding the correct way to calculate in Power Bi the Weighted Moving Average for delay delivery. Here is the case, assuming that we are ru...
ryan_mayu
2 years agoSuper User
could you pls provide some sample data and expected output?
gianma78
2 years agoFrequent Visitor
Hello Ryan, sorry for the late reply. In the meantime, requestor changed the specifics for this calc.
What we aim to obtain is the weighted moving average per scores, and the moving should be based on a fix amount of months (or rating received).
Assuming the following example
| Date of Delivery | Project | Rating |
| 06/2023 | P23_001 | 7 |
| 06/2023 | P23_002 | 5 |
| 08/2023 | P23_003 | 9 |
| 09/2023 | P23_004 | 8 |
12/2023 | P23_005 | |
| 01/2024 | P24_001 | 6 |
| 01/2024 | P24_002 | 9 |
It is a sample of the table I have, I can calculate the moving average as following DAX
"CALC Rating Moving Avg =
VAR _max_date = ENDOFMONTH('Calendar'[Date])
VAR _min_date = EDATE(_max_date,-6)
VAR _avg = CALCULATE(AVERAGE('Projects Log '[Feedback]),'Calendar'[Date] > _min_date && 'Calendar'[Date] <= _max_date)
RETURN _avg "
Any chance to have the weighted moving avg to have more emphasys to the recent Project delivered (guess I need to create the table of weights which is rolling on monthly basis)? And, if no rate is received, then skip the project from calculation
Any hint would be highly appreciated
- ryan_mayu2 years agoSuper User
what's the expected output basd on the sample data you provided?