Forum Discussion
mmace1
Impactful Individual
7 years agoDAX equivalent of SQL's NOT IN?
There's an extremely similar equivalent for SQL's IN - I have no imagination, so an example extremely similar to the last one I actually wrote: Card Sales =
CALCULATE (
[total valid spend],
...
- 7 years ago
Hi mmace1,
You need to place the NOT formula on the column and then use the in to make the level you need.
So you measure should look something like this:
MEASURE NOT IN = CALCULATE ( SUM ( Table1[Value] ); FILTER ( Table1; Table1[Category] = "C" && NOT ( Table1[CAT LEVEL] ) IN { 2; 3 } ) )As you can see below in category C the total is 1500 if you took out the category 2 and 3 it's 1000.
Regarrds,
MFelix
Anil_Mahanty
3 years agoFrequent Visitor
Card Sales =
CALCULATE (
[total valid spend],
FILTER ( payments, payments[paymentypeid] = 7 && not payments[paymentprocessorID] IN { 1, 5, 6, 9 } )
)