Forum Discussion
CecileF
7 years agoNew Member
Annual Average Calculations
Hello, I would like to calculate an annual average of values. However the calculation made by power BI with the quick measure average by year only count the distinct years where there is a value whi...
- 7 years ago
You may try the measure below.
Measure = IF ( HASONEFILTER ( Table1[year] ), SUM ( Table1[value] ), DIVIDE ( SUM ( Table1[value] ), COUNTROWS ( ALL ( Table1[year] ) ) ) )
v-chuncz-msft
7 years agoCommunity Support
You may try the measure below.
Measure =
IF (
HASONEFILTER ( Table1[year] ),
SUM ( Table1[value] ),
DIVIDE ( SUM ( Table1[value] ), COUNTROWS ( ALL ( Table1[year] ) ) )
)
- CecileF7 years agoNew Member
Hello,
Thanks a lot for your precious help ! :smileyvery-happy:
I just did a small change as I have filters in my model and changed the ALL in ALLSELECTED.
Have a great day !
Best regards
Cécile