Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

syntax error occurred during parsing: Invalid token, Line 1, Offset 44, ‘.

Hi, 

 

Please can someone supply me with some assistnace with an error. See below: 

 

DAX Meausure: 

 

LY Sales = CALCULATE([Total Sales],SAMEPERIODLASTYEAR(‘Date’[Date]))
 
Error that coming up is:
 
The following syntax error occurred during parsing: Invalid token, Line 1, Offset 44, ‘.
 

Stuck and cant progress to the next step in LAb2.

 

Thanks. 

  • Anonymous , This seems correct. Open edit Query/Data Transformation. I am hoping you see some errors there. Try to correct those

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    Ignore the syntax errors in your formula, you should use ' instead of ‘.

    This should be right formula.

    LY Sales = CALCULATE(SUM('Table'[Total Sales]),SAMEPERIODLASTYEAR('Date'[Date]))

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous , This seems correct. Open edit Query/Data Transformation. I am hoping you see some errors there. Try to correct those

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Ignore the syntax errors in your formula, you should use ' instead of ‘.

    This should be right formula.

    LY Sales = CALCULATE(SUM('Table'[Total Sales]),SAMEPERIODLASTYEAR('Date'[Date]))

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.