Search code examples
powerbidaxdaxstudio

Dax Studio - The syntax for Calculate is incorrect


I am learning to use DAX Studio to test out my DAX scripts,

DAX Studio says my script is wrong, but I am not sure what exactly is the problem

CummulativeWeek =
CALCULATE (
    SUM ( Data[Value] ),
    FILTER ( ALL ( Data[Week] ), Data[Week] <= MAX ( Data[Week] ) ),
    FILTER ( ALL ( Data[Year] ), Data[Year] == MAX ( Data[Year] ) )
)

enter image description here

I don't see what I am doing wrong. I checked the docummentation, YouTube vids, everything seems to be fine.

In PowerBI the command is executed just fine.

enter image description here

Is there a setting in DAX Studio that I am missing?


Solution

  • Are you using the EVALUATE keyword?

    Also, you need to return a table.

    Have a read here: https://daxstudio.org/docs/tutorials/writing-dax-queries/