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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
joshua1990
Post Prodigy
Post Prodigy

Next 12 and 24 Months based on selected value

Hello everyone!

I would like to sum up the next 12 and 24months based on the selected value.

I have an order table that shows me the orders for the next 36 months. This order table is archived weekly.

For every archived week, I have the next 36 months.

The structure is like this:

Archive-Week-YearValueWeek-Year
01-20215001-2021
01-20215002-2021
02-20214001-2021

 

 

Our fiscal calendar is linked to the "Week-Year" column so that we can aggregate this data into months, quarters etc.

The selected value is the column "Archive-Week-Year".

 

If I selected archive week "01-2021", then I would like to get the next 12 fiscal months including the months of the selected value.

How would you do that?

5 REPLIES 5
amitchandak
Super User
Super User

@joshua1990 , with a date table

examples

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

 

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

 

Rolling 12 till next12 month = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],maxX('Date', dateadd('Date'[Date],12,month)),12,MONTH))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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

@amitchandak Thank you! But are you sure, that this will work with a fiscal calendar with specific start and end dates for each fiscal month?

@joshua1990 , this rolling 12, should work with standard months , if you do have standard months if should.

 

FY with year

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

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

Ok, then it is not what I am looking for since we work with a fiscal calendar, as I said in the first post. 

@joshua1990 , FY with the standard month (Jan , feb match) it should work. If Month are 445 etc , 28*13

Create a Rank in you Calendar table on month or Week

Period Rank = RANKX(all('Period'),'Period'[year period],,ASC,Dense)  // format should be YYYYPP
This Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])))
Last Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])-1))

 

next 12 Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]>=max('Period'[Period Rank]) && 'Period'[Period Rank]<=max('Period'[Period Rank])+12 ))

 

Very similar way we deal with week

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.