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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Moving average calculate on the last year

Hi Community,

 

I'm a french beginner user of PowerBI, and I need your help for moving average tools. In fact I already tried to calculate moving average of total cumulate meters on last 3 years without including actual year (2019) of my project but that always include actual years (so 2017, 2018 and 2019).

 

Moving average is an interesting tools for my project to obtain an objective compared to our activity of last 3 years.

 

Could you help me to calculate a moving average of total cumulate meters of construction project on last 3 years, so for 2019, years 2016, 2017 and 2018. After I think I could calculate moving average on past 10 years.

 

Thanks for your help

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

You can use DAX expression below.

Measure = 
CALCULATE(
    [Sales], 
    DATESINPERIOD( 
        'Calendar'[Date], 
        MIN('Calendar'[Date]) -1, 
        -3, 
        YEAR
    )
)

Regards,
Mariusz

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
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

You can use DAX expression below.

Measure = 
CALCULATE(
    [Sales], 
    DATESINPERIOD( 
        'Calendar'[Date], 
        MIN('Calendar'[Date]) -1, 
        -3, 
        YEAR
    )
)

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @Mariusz 

 

Thanks for your help and your quick answer, that seems to work well.

 

Regards.

Antoine

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.