Forum Discussion
tarocha
Helper II
5 years agoFilter with three conditions
Hello can you help me? I have a column calculated to filter students who have not taken either class or another. I would like to include one more condition to search for those who did not take 3 ...
- 5 years ago
I was using the wrong filter for the third condition, instead of using || was using &&.
Now working.This is the code
Column = if('Table'[DONE]="NOT"&&'Table'[CLASS]="CLASS 1" && MAXX(FILTER('Table','Table'[NAME]=EARLIER('Table'[NAME])&&('Table'[CLASS]="CLASS 2"||'Table'[CLASS]="CLASS 3")),'Table'[DONE])="NOT","Not for class1&2&3", if('Table'[DONE]="NOT"&&'Table'[CLASS]="CLASS 1" && MAXX(FILTER('Table','Table'[NAME]=EARLIER('Table'[NAME])&&'Table'[CLASS]="CLASS 2"),'Table'[DONE])="NOT","Not for class1&2", if('Table'[DONE]="NOT"&&'Table'[CLASS]="CLASS 2" && MAXX(FILTER('Table','Table'[NAME]=EARLIER('Table'[NAME])&&'Table'[CLASS]="CLASS 3"),'Table'[DONE])="NOT","Not for class2&3", "")))
tarocha
Helper II
5 years ago
I was using the wrong filter for the third condition, instead of using || was using &&.
Now working.
This is the code
Column =
if('Table'[DONE]="NOT"&&'Table'[CLASS]="CLASS 1" && MAXX(FILTER('Table','Table'[NAME]=EARLIER('Table'[NAME])&&('Table'[CLASS]="CLASS 2"||'Table'[CLASS]="CLASS 3")),'Table'[DONE])="NOT","Not for class1&2&3",
if('Table'[DONE]="NOT"&&'Table'[CLASS]="CLASS 1" && MAXX(FILTER('Table','Table'[NAME]=EARLIER('Table'[NAME])&&'Table'[CLASS]="CLASS 2"),'Table'[DONE])="NOT","Not for class1&2",
if('Table'[DONE]="NOT"&&'Table'[CLASS]="CLASS 2" && MAXX(FILTER('Table','Table'[NAME]=EARLIER('Table'[NAME])&&'Table'[CLASS]="CLASS 3"),'Table'[DONE])="NOT","Not for class2&3",
"")))Anonymous
5 years agoNot applicable
Hi tarocha ,
Thanks for sharing the codes. If the problem has been resolved, could you please mark your post as Answered? It will help the others in the community find the solution easily if they face the same problem with you. Thank you.
Best Regards
Rena