Forum Discussion
PrachiD
8 years agoHelper I
Calculate Moving Average
Hello, Need help for the following I want to calculate average colunm as show in the above fig. The formula to calculate the Average is for April month it will remain as it is but for May...
- 8 years ago
Zubair_Muhammad
8 years agoCommunity Champion
HI PrachiD
Try this
Try this solution.
If you donot have a column for Month Numbers... add this calculated column
Month_Number =
SWITCH (
TableName[Month],
"January", 1,
"February", 2,
"March", 3,
"April", 4,
"May", 5,
"June", 6,
"July", 7,
"August", 8,
"September", 9,
"October", 10,
"November", 11,
"December", 12
)
Now you can use this MEASURE
Average =
CALCULATE (
AVERAGE ( TableName[Count] ),
FILTER (
ALL ( TableName ),
TableName[Month_Number] <= SELECTEDVALUE ( TableName[Month_Number] )
)
)- Zubair_Muhammad8 years agoCommunity Champion