Forum Discussion
Anonymous
4 years agoNot applicable
DAX query
Hi all, This is the DAX query I have written. Value = var m = (calculate(SUM('Table'[A]),FILTER('Table','Table'[B] = "0"))) But I still get an error, The syntax for ')' is incorrect. I a...
- 4 years ago
Hi Anonymous ,
When using VAR, RETURN is required to return the final value/formula you want. You can write your formula as below
Value = VAR m = CALCULATE ( SUM ( 'Table'[A] ), FILTER ( 'Table', 'Table'[B] = "0" ) ) RETURN mor simply
Value = CALCULATE ( SUM ( 'Table'[A] ), FILTER ( 'Table', 'Table'[B] = "0" ) )By the way in case you are not aware 0 is different from "0" as the latter (in double quotes) is a text string.
danextian
Super User
4 years agoHi Anonymous ,
When using VAR, RETURN is required to return the final value/formula you want. You can write your formula as below
Value =
VAR m =
CALCULATE ( SUM ( 'Table'[A] ), FILTER ( 'Table', 'Table'[B] = "0" ) )
RETURN
m
or simply
Value =
CALCULATE ( SUM ( 'Table'[A] ), FILTER ( 'Table', 'Table'[B] = "0" ) )
By the way in case you are not aware 0 is different from "0" as the latter (in double quotes) is a text string.