Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
CecileF
New 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 which is not the calculation I want as I need the annual average taking into account years empty.

 

Please see example below :

Annual average from 2008 (empty) to 2017 made manually (Total divided by 10 years) = 165 000/10 = 16 500 whereas Power BI calculates the average of values as to know 18 333 (corresponds to 165 000/9 years with a value)

 

Étiquettes de lignes200920102011201220132014201520162017Total général
Asie Pacifique200001000015000200002000020000200002000020000         165 000  

 

In advance thank you for your help !

 

Cécile 

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

 

@CecileF,

 

You may try the measure below.

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

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

 

@CecileF,

 

You may try the measure below.

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

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

Thanks a lot for your precious help ! Smiley Very 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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.