Forum Discussion

CecileF's avatar
CecileF
New Member
7 years ago
Solved

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...
  • v-chuncz-msft's avatar
    7 years ago

     

    CecileF,

     

    You may try the measure below.

    Measure =
    IF (
        HASONEFILTER ( Table1[year] ),
        SUM ( Table1[value] ),
        DIVIDE ( SUM ( Table1[value] ), COUNTROWS ( ALL ( Table1[year] ) ) )
    )