Forum Discussion
Issue with SAMETIMELASTYEAR
Hi there,
I'm having troubles with SAMETIMELASTYEAR. I want to show what the revenue was LY at the same time in the table below from April 2025 to September 2025. I have a date filter for this, but it doesn't apply to my LY calculation - it shows data beyond September 25.
How do I make it work?
See here PBIX link and below for details:
My LY measure is :
My calendar table is:
Hi,
Please try something like below.
Please check the below image and the attached pbix file.
I tried to create [LY_T&K fix] measure.
2 Replies
- danextianSuper User
Hi AlienBI
First, as a best practice, dispable auto-datetime and explicity create date element columns (year, month, quarter, etc). Auto-datetime creates an invisible table of dates for almost all date columns in your model and thus take up space.
Modify your formula to below:
CALCULATE ( SUM ( 'RA Subset'[T&K] ), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )Ensure that the date/calendar table has been marked as such - Set and use date tables in Power BI Desktop . If not you will have to explicityly include a REMOVEFILTERS to your measure.
CALCULATE ( SUM ( 'RA Subset'[T&K] ), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ), REMOVEFILTERS ( 'Calendar' ) ) - Jihwan_KimSuper User
Hi,
Please try something like below.
Please check the below image and the attached pbix file.
I tried to create [LY_T&K fix] measure.