1

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?

user2552108
  • 1,107
  • 3
  • 15
  • 30

1 Answers1

1

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/

Davide Bacci
  • 16,647
  • 3
  • 10
  • 36
  • I see. I thought the problem was there was something wrong with the CALCULATE command. Turns out DAX Studio does things different. Thanks! – user2552108 Jan 02 '23 at 09:23