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
Ramachandran
Helper III
Helper III

Rolling 12 month - previous year

Hi, I can get Rolling 12 month sales amount but I dont know how to get Rolling 12 month for previous year.
Someone assist me. how to get it.
Rolling 12 month - CALCULATE (
SUM ( 'SalesData'[SalesAmt]),
FILTER (
ALLSELECTED ( 'SalesData' ),
'SalesData'[Date] <= MAX ( 'SalesData'[Date] )
)
,'Calendar'[Years Between] = 0
)
How do I get "Rolling 12 Month - Previous Period" value?
I would like output is below,

Ramachandran_1-1652360602783.png

 

thanks,

Ram

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Ramachandran ,

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

 

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Ramachandran ,

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

 

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

Hi, After updating the Rolling 12 before 12 month logic code, I'm getting the Rolling value for all the month but not latest 12 month alone. the result is below

Ramachandran_0-1652371836332.png

But I want to show only last 12 months data alone.

Ramachandran_1-1652372162150.png

anything, I have to add condition for this.

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.