Rolling 12 Month Average Calculated Column in Date Table?

joeshu26

Board Regular
Joined
Oct 30, 2013
Messages
136
How could I create a calculated column in my 'Date' table which indicates if current row context is within last 365 days of the last date in my fact table?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I suggest a measure on either DateDim or FactTable:
DateLastFact:=calculate(max(FactTable[TransactionDate]),all(FactTable))

Then a calculated column in DateDim:
Within365Flag=if([date]>[DateLastFact]-365 && [date]<=[DateLastFact],"Y",blank())

I like having [DateLastFact] as a separate measure so it can be surfaced somewhere on the dashboard for the users to know the age of the dataset.
 
Upvote 0
Thanks PentaGalCXO, I was using the same last date measure in for other measures but wasn't able to get the syntax right for the calculated column! This works great though thank you!
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,535
Members
449,037
Latest member
tmmotairi

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