Forum Discussion
DAX equivalent of SQL's NOT IN?
- 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
I have a similar problem.
I want to return the plates that do not appear in this other table. However, the error below appears, follow my formula of the measure.
cars without service = CALCULATE (VALUES ('3A_CHAMADO_SERVICOS_CAL_VIEW (2)' [License Plate]);
FILTER (GWT_CARTAO_EQUIPAMENTO; NOT (
VALUES (GWT_CARTAO_EQUIPAMENTO [Plate])) in {VALUES ('3A_CHAMADO_SERVICOS_CAL_VIEW (2)' [Plate]))))
Helpp
Error Message:
MdxScript(Model) (37, 44) Erro de cálculo na medida '_Medidas'[carros sem serviço]:Uma tabela de vários valores foi fornecida, sendo que um único valor era esperado.