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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Pmike
Advocate I
Advocate I

12 Month Rolling - Removing future months from calc

 

I need help with a 12 month rolling fomula.  The formula I created in DAX as a measure is:

 

12 Mo Rolling = CALCULATE(SUM('SELL THRU'[Sales Dolalrs]),
DATESBETWEEN(
'SELL THRU'[Date].[Date],
NEXTDAY(SAMEPERIODLASTYEAR(LASTDATE('SELL THRU'[Date].[Date]))),
LASTDATE('SELL THRU'[Date].[Date])
))

 

 

This appears to work, however my problem is that I don't want the formula to include anything for future months.  If I have 2016 and 2017 data the formula will add, for example, sales from April 2017 back to May 2016 for April 12 Mo Rolling, however when I get to a future month it accumulates back 12 months but I want to show zero.

 

Any suggestions would be appreciated.

 

Thanks,

 

PMike

0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.