Forum Discussion
Prior Year dax
Hello,
i am not sure what i am doing wrong, but my CY and PY results are the same.
CY formula used
=calculate(sum([Amount]),DATESMTD('Calendar'[Date]))
PY formula
=calculate(sum([Amount]),DATEADD('Calendar'[Date],-1,YEAR))
5 Replies
- amitchandak
Super User
YuliyaMusiyuk , couple of reason can be .
Calendar is not marked as date tbale. option on right click.
you are not using period columns from Calendar table
Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw
- YuliyaMusiyukRegular Visitor
thank you very much! my Calendar is a date table, i just double checked on that.
Could you elaborate on the 2d? my data goes by day, therefore i figured i'd need to grab Calendar[Date]...
- amitchandak
Super User
YuliyaMusiyuk , If you take, day, month, year, or any period that should come from date table in visual
Also try this one
calculate(sum([Amount]),datesmtd(DATEADD('Calendar'[Date],-1,YEAR)))
- YuliyaMusiyukRegular Visitor
Could someone please assist? it's been days - and i cannot figure this out...