Forum Discussion

ViorelCa's avatar
ViorelCa
Helper I
9 years ago
Solved

Variable error powerpivot

Dear Colleagues,   When I calculate this single expression it is ok:   LastActualDate:=LASTNONBLANK(Clasa6si7[FECHA],1)   But when I wrap it inside a variable, I get the error "The syntax for L...
  • Datatouille's avatar
    9 years ago

    Hi ViorelCa

     

    1. DAX variables are only available from the 2015 edition of DAX so: PowerPivot for Excel 2016, Power BI Desktop & SSAS 2016. Thus, not in PowerPivot for Excel 2013.

    2. In any of the three softwares mentioned above, you should remove the " " in the variable definition and also remove the 'filter' function (which is useless thanks to the variable).

    This one would work:

     

    BudgetYTD = VAR LastActualDate=LASTNONBLANK(Clasa6si7[FECHA],1) RETURN
    Calculate( SUM(AppendOGOAll[P2017cost]) , CalendarTable[Calendar Date] <= LastActualDate)