Forum Discussion
paris
4 years agoHelper V
Add previous 4 years average using DAX
Hi All, I have monthly sales by city from 1 Jul 2017 to 1 Aug 2021. I would like to add 4 year average sales by city to my graph(like red line in the graph) Please help! I tried to us...
v-zhangti
4 years agoCommunity Support
Hi, paris
For calculating the average, you can try the following two schemes.
1. Calculated column
Average =
CALCULATE (
AVERAGE ( Sales[Sales] ),
FILTER ( Sales, Sales[Month] = EARLIER ( Sales[Month] ) )
)
2. Measure
Measure =
CALCULATE (
AVERAGE ( Sales[Sales] ),
FILTER ( ALL ( Sales ), Sales[Month] = MAX ( Sales[Month] ) )
)
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.