# SAMEPERIODLASTYEAR not working



## Sharkie21 (Oct 12, 2017)

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.


----------



## Matt Allington (Oct 13, 2017)

Sharkie21 said:


> I keep getting the same results for the current period and the prior period.
> 
> My formulas are:
> 
> ...



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


----------



## masterelaichi (Oct 15, 2017)

Matt Allington said:


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



Hi Matt,

Could you please explain what the difference is?

Thanks


----------



## Matt Allington (Oct 16, 2017)

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.


----------



## masterelaichi (Oct 16, 2017)

Matt Allington said:


> 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


----------

