SAMEPERIODLASTYEAR not working
Thanks:  0
Likes:  0

1. ## SAMEPERIODLASTYEAR not working

I keep getting the same results for the current period and the prior period.

My formulas are:

Total Cost = sum(Data[Claim_Cost])

Total Cost LY = Calculate([Total Cost],SAMEPERIODLASTYEAR('Date'[Date].[Date]))

When I drop these two measures into a table visual, I get the same value for each month/year.

e.g.

Jan 2015 - Shows 39M for both Total Cost and Total Cost LY.

Whereas Jan 2015 was 39M and Jan 2014 was 34M

Thank you.

2. ## Re: SAMEPERIODLASTYEAR not working

Originally Posted by Sharkie21
I keep getting the same results for the current period and the prior period.

My formulas are:

Total Cost = sum(Data[Claim_Cost])

Total Cost LY = Calculate([Total Cost],SAMEPERIODLASTYEAR('Date'[Date].[Date]))

When I drop these two measures into a table visual, I get the same value for each month/year.

e.g.

Jan 2015 - Shows 39M for both Total Cost and Total Cost LY.

Whereas Jan 2015 was 39M and Jan 2014 was 34M

Thank you.
try deleting the last.[date] so just use Date[Date]

3. ## Re: SAMEPERIODLASTYEAR not working

Originally Posted by Matt Allington
try deleting the last.[date] so just use Date[Date]
Hi Matt,

Could you please explain what the difference is?

Thanks

4. ## Re: SAMEPERIODLASTYEAR not working

Microsoft has built capabilities for Power Pivot to do time intelligence calculations without the need for a calendar table. This is called auto time telligence. It can be turned off in the settings. The date.date syntax is part of that auto time intelligence. It is designed (in my view) for "casual" use of Power Pivot without the need to know DAX. I personally never use it and prefer to have control with a calendar table.

5. ## Re: SAMEPERIODLASTYEAR not working

Originally Posted by Matt Allington
Microsoft has built capabilities for Power Pivot to do time intelligence calculations without the need for a calendar table. This is called auto time telligence. It can be turned off in the settings. The date.date syntax is part of that auto time intelligence. It is designed (in my view) for "casual" use of Power Pivot without the need to know DAX. I personally never use it and prefer to have control with a calendar table.

Thanks Matt

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•