Rolling 5years - DAX measure

OlaSa

New Member
Joined
Mar 22, 2015
Messages
23
I have a table (matrix) with...
RegistrationYear (2001, 2002...2025)
Brand (MB, VW, ...)
NoOfCarsSold (quantity)


How can I calculate the 'Rolling 5years park' by Brand and Year ?

Rolling 5years park:
Rolling5-Yr2005 = Sum(2001, 2002, 2003, 2004, 2005) by brand
Rolling5-Yr2006 = Sum(2002..2006) ...
etc

Yr2001 to Yr2004 will be blank since it's less then 5 years.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hello Matt,

Actually, it's already a table, with 3 Columns: Brand, Year, NoOfCarsSold
I had a look at your site but couldn't figure out how to apply the formulas.


This is as far as I could come:

Test:=IF([Check];CALCULATE(SUM([NoOfCarsSold]);
ALLEXCEPT(Table1;Table1[Brand]);
AND(Table1[Year]<=2025;Table1[Year]>=2007));0)

Check:=AND(
SUM(Table1[Year])<=[Year-End];
SUM(Table1[Year])>=([Year-Start]+9))
 
Upvote 0
If it simplifies: Take away the Brand-column. That leaves two columns; [Year] and [NoOfCarsSold].
 
Upvote 0
Something like this:
(I have not worked this case for less than 5 years)
Sory, change F2

7gpn1tgxAUqbxLJl77S8yNPIrUN9Lkf69f_n4JtgnJI

[\IMG]

Link File:https://www.dropbox.com/s/5er6cgts362dlsw/Rolling5years.xlsx?dl=0
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top