Forum Discussion
Anonymous
3 years agoNot applicable
Calculating average on year
Hi all, as my subject seems very easy to solve, I don't succeed in this. I found already similar topics on this forum and used the formulas mentioned there, but it still doesn't give me the resul...
- 3 years ago
Did you add "avg prm" as a computed column instead of a measure?
Anonymous
3 years agoNot applicable
It still doesn't work, although I'm following your instructions 🙂
Formula used:
avg prm =
VAR count_months = CALCULATE(DISTINCTCOUNT('Date'[Month Number])
,CALCULATETABLE(Purchases_All,ALL(),VALUES('Date'[Year]))
,CROSSFILTER('Date'[Date],Purchases_All[Date],Both))
VAR count_quantity = CALCULATE(SUM(Purchases_All[Quantity]),ALL('Date'),VALUES('Date'[Year]))
RETURN IF(COUNTROWS(Purchases_All)>0, DIVIDE(count_quantity, count_months))
Relations between the tables:
Report:
I have the feeling that it has to do with something in my date-table, no?
sjoerdvn
Solution Sage
3 years agoDid you add "avg prm" as a computed column instead of a measure?
- Anonymous3 years agoNot applicable
Hallelujah, it works 🙂