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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
OhLookAnError
Helper I
Helper I

Rolling trailing 12 month average

Hey everyone, this seems simple and I have got it to work before but I cant seem to get it to work in this case. 

 

I just need the line to be the average of the last 12 months at each column point if that makes sense. I treid a measure I have used before with success although I previously used it as days not months and I tried a measure I found on here that was for someone else that had the same question. below is the two measures I have tried and screenshots below. 

 

T12m Sales $'s =

     VAR NUMMONTHS = 12

     VAR ROLLINGSUM =
                      Calculate(
                      SUM('Sales'[Sales]),
                      DATESINPERIOD('Sales'[Date],
                      LASTDATE('Sales'[Date]), - NUMMONTHS, MONTH))
    RETURN
    ROLLINGSUM/NUMMONTHS
 
Sales12M = CALCULATE ('Sales'[T12m Sales $'s],
    DATESBETWEEN (
        'Sales'[Date],
        NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Sales'[Date] ) ) ),
        LASTDATE ( 'Sales'[Date] )
    )
)
 
 
 
OhLookAnError_0-1702995842580.pngOhLookAnError_1-1702995877831.png

 

Thanks in advance! 
2 REPLIES 2
Anonymous
Not applicable

Hi @OhLookAnError ,

 

Based on the information you provided, I am not sure what kind of error you encountered during the process. What is your reported error, can you attach a screenshot of the error or provide a pbix file without privacy?

 

Here is the version of my Power BI Desktop:

vyifanwmsft_0-1703057323987.png

 

 

Below is the screenshot and pbix file of my reproduction:

 

vyifanwmsft_1-1703057323991.png

 

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Yifan Wang

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

Thanks for the response! To clarify, I am not getting an error, it just isnt returning the avaergae of the prior 12 months. The value just goes up and down correlating directly to each month instead slighter changes to represent the average. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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