Forum Discussion
s_mansell
6 years agoHelper I
Filtering Out Category
Hi all,
Is there a way I can use and opposite of the 'IN' function to filter a measure? I have previously used a quick measure to filter my value e.g.
Sales filterd out 'B'=
CALCULATE(
[Sales],
'Cost Account'[Category] IN {
BLANK(),
"A",
"C",
"D",
"E"})
This does work however the list of categories will change meaning the value won't be correct if any changes to the list occur.
Instead I am looking to filter out 'B' rather than keep in all other categories e.g.
Sales filterd out 'B'=
CALCULATE(
[Sales],
'Cost Account'[Category] OUT {
BLANK(),
"B"})
How can I write this correctly?
- Anonymous6 years ago
Hi s_mansell ,
You can write this as
Sales filterd out B=CALCULATE([Sales],NOT'Cost Account'[Category] IN {BLANK(),"B"})Regards,
Harsh NathaniDid I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
2 Replies
- AnonymousNot applicable
Hi s_mansell ,
You can write this as
Sales filterd out B=CALCULATE([Sales],NOT'Cost Account'[Category] IN {BLANK(),"B"})Regards,
Harsh NathaniDid I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
- v-lili6-msftCommunity Support
hi s_mansell
You could use not in logic in dax, but it is this syntax NOT <column/expression> IN {list}
it is like harshnathani's reply.
Regards,
Lin