Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DateAdd Measure

Hi Guys,

 

Please I am trying to create new measure this the follwoing:

 

LY Sales = CALCULATE([TotalSales], DATEADD('Date'[Date],-1,Year))
 
PowerBI retrurns error on the 'Year'
  
Kindly help!
 
 
  • Hi Anonymous,

     

    If the issue still occur, kindly share your pbix to me . Please upload your files to One Drive and share the link here.

     

    Regards,

    Frank

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Stachu,

       

      Please se the screen shoot above

      Thanks

      • Stachu's avatar
        Stachu
        Community Champion

        weird, syntax looks correct, but maybe you can try with this one:

        LY Sales =
        CALCULATE ( [TotalSales], DATEADD ( 'Date'[Date], -1, YEAR ) )

        I usually use https://www.daxformatter.com/ to verify syntax, maybe the spaces+capital letters will help

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi Anonymous,

     

    If the issue still occur, kindly share your pbix to me . Please upload your files to One Drive and share the link here.

     

    Regards,

    Frank