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
iluvcoding_91
Helper I
Helper I

DAX to calculate prior trailing 12 months

Hey guys, so I'm calculating the current trailing 12 month totals (May 2021 through May 2022 sales), and I'm trying to compare this to the prior trailing 12 month totals (May 2020 through May 2021 sales). I can get the current trailing 12 month total by using the DAX formula below, but how to do I get the prior trailing 12 month total? Any suggestions would be great. Thanks!!

 

iluvcoding_91_0-1654559578849.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@iluvcoding_91 , Rolling 12 before 12

 

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

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

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @iluvcoding_91,

 

May I know whether you get the desired result with the dax from amitchandak? If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

amitchandak
Super User
Super User

@iluvcoding_91 , Rolling 12 before 12

 

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

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
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.