Hi,
Try this :
WITH
SET LastWeek AS ClosingPeriod([Date].[Calendar Weeks].[Calendar Week]
, [Date].[Calendar Weeks].DefaultMember)
SET Last13Weeks AS {LastWeek.Item(0).Lag(12):LastWeek.Item(0)}
SELECT Last13Weeks ON 0
FROM [Adventure Works]
WHERE ([Measures].[Sales Amount]);
Regards,
Lukas
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
What can I do if my transaction log is full?--- Hot issues November
How to convert Profiler trace into a SQL Server table -- Hot issues November