Forum Discussion

YuliyaMusiyuk's avatar
YuliyaMusiyuk
Regular Visitor
5 years ago

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

    • YuliyaMusiyuk's avatar
      YuliyaMusiyuk
      Regular 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's avatar
        amitchandak
        Icon for Super User rankSuper 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)))

  • Could someone please assist? it's been days - and i cannot figure this out...