Forum Discussion
webportal
9 years agoImpactful Individual
Using a Boolean expression with CALCULATE
Can someone explain me why this expression of a calculated measure works: Measure = CALCULATE(SUM(Facts[Turnover]);FILTER('Facts';'Facts'[UnitPrice]>=50)) Whereas this one doesn't: Measu...
- 9 years agoThis is correct. No measure or CALCULATE expression, unless you write a full FILTER expression around it.
webportal
9 years agoImpactful Individual
As a measure.
LaurentCouartou
9 years agoSolution Supplier
If 'Facts'[UnitPrice] is a calculated column, this expression
Measure = CALCULATE(SUM(Facts[Turnover])
;'Facts'[UnitPrice]>=50
)
is just a shortcut for:
Measure = CALCULATE(SUM(Facts[Turnover])
;FILTER( ALL('Facts'[UnitPrice])
;'Facts'[UnitPrice]>=50
)
)
If 'Facts'[UnitPrice] is a measure, however, you will get an error message about CALCULATE not being allowed in a filter expression expression (of a CALCULATE expression).
Is it what is happening here?