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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
water-guy-5
Helper III
Helper III

How to find the monthly average over multiple years

I have sales dating back 5 years.

I would like to find the 5 year January average, February average, etc.

Thanks!

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

Hi, @water-guy-5 

 

You are trying to get the average of each month for the last five years right?
Why not create a matrix and change the way the values are aggregated to the average, which doesn't even require adding any additional columns or measures.

vangzhengmsft_0-1633663181117.png

 

Please correct me if I didn't understand the question correctly and consdier sharing more details about it or a simple sample file without any sesentive information for further discussion.

 

 

Best Regards,
Community Support Team _ Zeon Zheng
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-angzheng-msft
Community Support
Community Support

Hi, @water-guy-5 

 

You are trying to get the average of each month for the last five years right?
Why not create a matrix and change the way the values are aggregated to the average, which doesn't even require adding any additional columns or measures.

vangzhengmsft_0-1633663181117.png

 

Please correct me if I didn't understand the question correctly and consdier sharing more details about it or a simple sample file without any sesentive information for further discussion.

 

 

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

DataInsights
Super User
Super User

@water-guy-5,

 

Try this measure. It also works with datasets that contain more than five years:

 

Five Year Average = 
VAR vMaxYear =
    CALCULATE ( MAX ( Table1[Year] ), ALL ( Table1[Year] ) )
VAR vResult =
    CALCULATE (
        AVERAGE ( Table1[Amount] ),
        ALL ( Table1[Year] ),
        Table1[Year] >= vMaxYear - 4
    )
RETURN
    vResult

 

DataInsights_0-1633529424889.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors