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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Pbiuserr
Post Prodigy
Post Prodigy

12 month rolling avg give same output as 3 month rolling avg

Hello,

I have a measure
12mth rolling avg = 

    VAR __LAST_DATE = LASTDATE('calendar'[Date])
    VAR RollingAverage =
        AVERAGEX(
            DATESBETWEEN(
                'calendar'[Date],
                DATEADD(__LAST_DATE, -12, MONTH),
                __LAST_DATE
            ),
            [SumOfSales]    
        )
    RETURN IF(__LAST_DATE > TODAY(), BLANK(), RollingAverage)

and I also have the same 3 month rolling avg which is -3 MONTH in DATEADD function, but they gives me same result through entire chart. My point is to have " If look at Feb 2023 then you see the sum of the last 12 months divided by 12." and "look at Feb 2023 then you see the sum of the last 3 months divided by 3."

Any ideas?
2 REPLIES 2
jaweher899
Impactful Individual
Impactful Individual

Could you please provide a .pbix file? 

 

I'm not able to see why if you replace 12 by 3 it returns wrong results.

I can't 😞 clients data. I got monthyear as an axis and as Y axis just this line. I can see slight differences if I slice the data by some dimension but without it has the same values

but you say that logic is there accurate? then I need to wait for more data, maybe thats the problem 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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