Forum Discussion

kelly008's avatar
kelly008
Helper I
3 years ago
Solved

Syntax For ')' Error Message

Hello,

 

I am currently getting this error message: 

 

Text version:   The syntax for ')' is incorrect. (DAX(VAR OverallStartDate = [OverallStartDate]VAR StartDate = CALCULATE( MIN(Project[Starting_Date]), REMOVEFILTERS(dimDate) )VAR Result = INT(StartDate - OverallStartDate)RETURN)).

 

For this Measure:

 

I'm using this measure for the creation of a Gaant Chart Project Scheduler. 

 

Any help would be greatly appreciated.

Thanks!

  • kelly008  try it

    VAR OverallStartDate = [OverallStartDate]
    VAR StartDate = 
    CALCULATE( 
    MIN(Project[Starting_Date]), 
    REMOVEFILTERS(dimDate) 
    )
    VAR Result = INT(StartDate - OverallStartDate)
    RETURN
    Result

     

3 Replies

  • daXtreme's avatar
    daXtreme
    Solution Sage

    kelly008 

     

    Some highlights:

     

    1. Do not name your variables exactly as your measures.

    2. The RETURN must return something. Can't be hanging all by itself.

    3. Please always format your DAX correctly.

     

    If you don't want to format by hand, use www.daxformatter.com. This free tool will also highlight any syntax errors to you.

  • DimaMD's avatar
    DimaMD
    Solution Sage

    kelly008  try it

    VAR OverallStartDate = [OverallStartDate]
    VAR StartDate = 
    CALCULATE( 
    MIN(Project[Starting_Date]), 
    REMOVEFILTERS(dimDate) 
    )
    VAR Result = INT(StartDate - OverallStartDate)
    RETURN
    Result