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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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