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
Madhatter
Frequent Visitor

Rolling 12 month average

Hi,

I used the quick measure to create a 12 month rolling average and selected 0 for period after but the quick measure is going up to December of 2023, I would just like it to look at the preceding 12 months, is this possible?

 

ChangeTicketsCcreatedRA12 =
IF(
    ISFILTERED('Query1'[Date]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    VAR __LAST_DATE = ENDOFMONTH('Query1'[Date].[Date])
    VAR __DATE_PERIOD =
        DATESBETWEEN(
            'Query1'[Date].[Date],
            STARTOFMONTH(DATEADD(__LAST_DATE, -12, MONTH)),
            __LAST_DATE
        )
    RETURN
        AVERAGEX(
            CALCULATETABLE(
                SUMMARIZE(
                    VALUES('Query1'),
                    'Query1'[Date].[Year],
                    'Query1'[Date].[QuarterNo],
                    'Query1'[Date].[Quarter],
                    'Query1'[Date].[MonthNo],
                    'Query1'[Date].[Month]
                ),
                __DATE_PERIOD
            ),
            CALCULATE(SUM('Query1'[ChangeTicketsCreated]), ALL('Query1'[Date].[Day]))
        )
)
1 REPLY 1
amitchandak
Super User
Super User

@Madhatter , You should use a date table and measure like

 

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))

 

you can also consider window function

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.