cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Medmbchr
Helper IV
Helper IV

Calculate sums of 12 months rolling year

Hi

 

I would like to calculate the sum of consumptions over a 12 month rolling period, but for each month.

Exemple:

We are in December 2022, hence I would like the following:

- Sum of consumption in October 22

- Sum of consumption in September 22

- ....

- Sum of consumption in December 21

 

I tried to use DATESINPERIOD but doesn't seem to work out

 

Any leads?

 

Thanks

1 REPLY 1
amitchandak
Super User
Super User

@Medmbchr , with help from date table

 

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

 

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

 

 

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

 

You can use -11 or -10 as per need

 

Rolling Months Formula: https://youtu.be/GS5O4G81fww

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.