Forum Discussion
Error Using a Dax Measure as a constant
- Anonymous1 year ago
Thanks for the reply from lbendlin.
Hi CarlosPelay,
As lbendlin says, when we try to use a measure as a filter in another measure, a syntax error occurs because the measure cannot be calculated as a fixed constant value.
To solve this problem, we can use a variable in the second measure to store the value of __CURRENT CAMPAIGN YR.
Please use the following DAX:
Appeals_Total$_SPONSORSHIP = VAR _a=[__CURRENT CAMPAIGN YR] RETURN CALCULATE(SUM('Final_RE_Gift Detail'[Appeal Split Amount]),'Final_RE_Gift Detail'[Appeal]="BBFC Sponsorship",'Final_RE_Gift Detail'[Campaign]=_a)Best Regards,
ZhuIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from lbendlin.
Hi CarlosPelay,
As lbendlin says, when we try to use a measure as a filter in another measure, a syntax error occurs because the measure cannot be calculated as a fixed constant value.
To solve this problem, we can use a variable in the second measure to store the value of __CURRENT CAMPAIGN YR.
Please use the following DAX:
Appeals_Total$_SPONSORSHIP =
VAR _a=[__CURRENT CAMPAIGN YR]
RETURN
CALCULATE(SUM('Final_RE_Gift Detail'[Appeal Split Amount]),'Final_RE_Gift Detail'[Appeal]="BBFC Sponsorship",'Final_RE_Gift Detail'[Campaign]=_a)
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Zhu! This was very helpful