Forum Discussion
RaffiKouzoudj
5 years agoHelper III
Calculate Average per category
Hello, I want to calculate the Average (mean) of the 2020 and 2021 based on the values on the above table. Example: (3792 + 3082 + 3337 + 3199) / 4 Any help! thank You
- Anonymous5 years ago
You don't show the model, so I can only give you a very general formula...
[Measure] = AVERAGEX( DISTINCT( T[Month] ), [Your Base Measure] ) - 5 years ago
Please try measure as:
Measure = CALCULATE( AVERAGEX(DISTINCT(Sub_main [Month]),Sub_main [Total]), ALL('Table') )Best Regards,
LinkIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
5 years agoNot applicable
You don't show the model, so I can only give you a very general formula...
[Measure] =
AVERAGEX(
DISTINCT( T[Month] ),
[Your Base Measure]
)RaffiKouzoudj
5 years agoHelper III
Dear Daxer,
I used the formula you suggested however, i am getting the same values as the first column.
1) Total = SUM(Sub_main[2021])
2) Measure = AVERAGEX( DISTINCT(Sub_main[Month] ), Sub_main[Total]).
thank you
- ryan_mayu5 years agoSuper User
maybe you can try
VAR _max=calculate(max(date),all(table))
return divide(calculate(sum(value),filter(all(table),year(date)=2021)), month(_max))