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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vmkumar1
Frequent Visitor

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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