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
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 solved this by using excel as a source. Following this method I don't have to work with HTML code in my power query to get all the sheets
https://stackoverflow.com/questions/45945815/how-to-connect-google-sheet-with-power-bi