Forum Discussion
Measure return correct value , but get syntax shown error sign , how to clear it ?
Hi All
Below measure working fine :-
May i know how to clear the error ?
Below my PBI file :-
Paul Yeo
Hi, admin11
Have your problem been solved? I checked your file, It seems that the third parameter in TOTALYTD can only write one filter, and the second will become the fourth parameter by default, causing errors, but the actual calculation will be included.
You can easily use calculate to remove red error.
Like this:
_LYTD_REV TDS = VAR _max = DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), DAY ( TODAY () ) ) RETURN CALCULATE ( TOTALYTD ( ( 'GL'[AMOUNT_REV] ), DATEADD ( 'Date'[Date], -1, YEAR ), 'Date'[Date] <= _max ), FILTER ( GL, [SOURCE] = "TS" ) )Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- v-janeyg-msftCommunity Support
Hi, admin11
Have your problem been solved? I checked your file, It seems that the third parameter in TOTALYTD can only write one filter, and the second will become the fourth parameter by default, causing errors, but the actual calculation will be included.
You can easily use calculate to remove red error.
Like this:
_LYTD_REV TDS = VAR _max = DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), DAY ( TODAY () ) ) RETURN CALCULATE ( TOTALYTD ( ( 'GL'[AMOUNT_REV] ), DATEADD ( 'Date'[Date], -1, YEAR ), 'Date'[Date] <= _max ), FILTER ( GL, [SOURCE] = "TS" ) )Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
I'm not 100% sure but you can clean it up a little by removing the Filter function. This shouldn't be needed as the TOTALYTD function is already expecting a filter here.
LYTD_REV TDS = VAR _max = DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), DAY ( TODAY () ) ) RETURN TOTALYTD ( ( 'GL'[AMOUNT_REV] ), DATEADD ( 'Date'[Date], -1, YEAR ), 'Date'[Date] <= _max, GL[SOURCE] = "TS" )