Sameperiodlastyear with filter

Hello all
I would like to do a measure like this :
CALCULATE([T Valor], SAMEPERIODLASTYEAR( Dates[Date] ), ‘Main Data’[Type] = “Actual”)
For some reason it’s not working. Anyone knows why and would it be better to do it other way?
Also, i would need later for a TOTALYTD on this one. Usualy i just put the measure before in it and it’s all good.
Any help?
Thank you all

I’ve change the measure above because i’ve created a new one:

T Valor Actual = CALCULATE([T Valor], ‘Main Data’[Type] = “Actual”)

So, now that i have narrow the error, i still can’t do this simple one. I can but it’s not showing any result.
My new measure:

T Valor Actual LY = CALCULATE([T Valor Actual], DATEADD(Dates[Date], -1, YEAR))

And i’ve try with DATEADD and also not working…

Any clues?

Guys, you’re not gonna believe this. I’m so ashamed…it’s working after all.
Can you believe that my dates table didn’t have that date?
So. It’s solved and i’m sorry for wasting your time reading this stupid post.
Best regards


Have you marked your Dates table as a date table and validated on your Dates[Date] field? If it doesn’t validate properly that might be the source of the problem.

If it does validate OK, please just post your PBIX, which will make it a lot easier to diagnose what’s going on.


  • Brian

I did Brian. Everything’s ok now. It was the problem of not having that specific date in my dates table. All good now. Thank you for asking.
Best regards