March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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 LastActualDate is incorrect"
Am I doing something wrong? (Excel2013 Powerpivot)
BudgetYTD:=
VAR
LastActualDate:=LASTNONBLANK(Clasa6si7[FECHA],1)
RETURN
CALCULATE(
SUM(AppendOGOAll[P2017cost]),
FILTER(
ALL(CalendarTable[Calendar Date]),
CalendarTable[Calendar Date] <= LastActualDate
))
Solved! Go to Solution.
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)
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)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
202 | |
137 | |
106 | |
70 | |
68 |