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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Help

@Anonymous  this was a great post put on by you which I have used. I rolling 13 months. I need the data to be a Rolling 12 months.

How can I do this please?

Can @Anonymous or anyone else help?

 

This is the link - https://community.powerbi.com/t5/Desktop/Rolling-13-months-DAX/td-p/663677

 

Thanks

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please update the measures like this.

2Sales Rolling 12 ACT = 
VAR Maximum_Date =
    MAX ( 'Rolling Calendar'[Date] )
VAR Minimum_Date =
    EDATE(Maximum_Date,-11)
VAR Selected_Date =
    MAX ( 'Calendar'[Date] )
RETURN
    IF (
        Selected_Date <= Maximum_Date
            && Selected_Date >= Minimum_Date,
        [Sales ACT],
        BLANK ()
    )
2Sales Rolling 12 Month ACT (Totals) = 
IF (
    HASONEFILTER ( 'Calendar'[Date] ),
    [2Sales Rolling 12 ACT],
    SUMX ( 'Calendar', [2Sales Rolling 12 ACT] )
)

Capture.PNG

 

Also please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please update the measures like this.

2Sales Rolling 12 ACT = 
VAR Maximum_Date =
    MAX ( 'Rolling Calendar'[Date] )
VAR Minimum_Date =
    EDATE(Maximum_Date,-11)
VAR Selected_Date =
    MAX ( 'Calendar'[Date] )
RETURN
    IF (
        Selected_Date <= Maximum_Date
            && Selected_Date >= Minimum_Date,
        [Sales ACT],
        BLANK ()
    )
2Sales Rolling 12 Month ACT (Totals) = 
IF (
    HASONEFILTER ( 'Calendar'[Date] ),
    [2Sales Rolling 12 ACT],
    SUMX ( 'Calendar', [2Sales Rolling 12 ACT] )
)

Capture.PNG

 

Also please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

@v-frfei-msft brilliant thanks

Anonymous
Not applicable

Hi @Anonymous 
Would it help to use 

 

Sales Rolling 12 ACT = 
VAR Maximum_Date =
    MAX ( 'Rolling Calendar'[Date] )
VAR Minimum_Date =
    DATE ( YEAR ( Maximum_Date ) - 1; MONTH ( Maximum_Date ); DAY( Maximum_Date ) )
VAR Selected_Date =
    MAX ( 'Calendar'[Date] )
RETURN
    IF (
        Selected_Date <= Maximum_Date
            && Selected_Date > Minimum_Date;
        [Sales ACT];
        BLANK ()
    )

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.