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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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