Forum Discussion
jct999
Advocate II
6 years agoDAX :
Hi, I have a table with 3 columns : COUNTRY (string) LEVEL (integer) Quantity (integer) I want to set up a Pivot Table with : Line : COUNTRY Column : LEVEL Values : 3 measures : Measur...
AntrikshSharma
Community Champion
6 years agoIf you want to attain the same behaviour without variables then you will have to use explicit FILTER, for example.
Measure =
CALCULATE (
[Total Sales],
FILTER (
ALL ( Product[Brand] ),
Product[Brand] = SELECTEDVALUE ( Product[Brand] )
)
)
Because writing aggregation functions like SUM, AVERAGE, MAX are not allowed while doing boolean filter operations, and same is for SELECTEDVALUE, hence the following won't work.
Measure =
CALCULATE (
[Total Sales],
'Product'[Brand] = SELECTEDVALUE ( 'Product'[Brand] )
)
lbendlin
Super User
6 years agoThere's also the added complexity with FILTER (ALL()) - that may produce more results than intended in the visual context.
- AntrikshSharma6 years ago
Community Champion
Correct, in that case he can either wrap CALCULATE's filter arguments with KEEPFILTERS or use VALUES as per the requirements.