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
Anonymous
Not applicable

Last 12 months vs 12 Months prior sales Comparison

Hi All,

 

I have my sales data from 2016 (more than 36 Months). I would like to compare my sales Rev of last 12 months vs 12 months prior to last 12 months, i.e  last 24 months. I have a date filed as purchase date. I am trying to create a measure. Could you please help me here. Thanks.

4 REPLIES 4
Anonymous
Not applicable

so 
18 Sept 2018 to 17 Sept 2019
compared to
18 Sept 2017 to 17 Sept 2018
?

Anonymous
Not applicable

@Anonymous Yes. Correct. Like this i am comparing Apples to Apples, Last 12 months Vs 12 months prior.Thanks.

Try

last 12 month Sales = 
Var _endDate= Maxx(ALLSELECTED('Date'[Date Filer]),ENDOFMONTH('Date'[Date Filer]))
Var   _start_date= minx(ALLSELECTED('Date'[Date Filer]),DATEADD(STARTOFMONTH('Date'[Date Filer]),-12,MONTH))


return
calculate(sum(Sales[Sales Amount]),Sales[Sales Date] >= _start_date && Sales[Sales Date] <= _endDate)


last to last 12 Sales = 
Var _endDate= Maxx(ALLSELECTED('Date'[Date Filer]),DATEADD(STARTOFMONTH('Date'[Date Filer]),-13,MONTH))
Var   _start_date= minx(ALLSELECTED('Date'[Date Filer]),DATEADD(STARTOFMONTH('Date'[Date Filer]),-24,MONTH))


return
calculate(sum(Sales[Sales Amount]),Sales[Sales Date] >= _start_date && Sales[Sales Date] <= _endDate)
 
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
Anonymous
Not applicable

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.