Forum Discussion
OsmanEmi
5 years agoFrequent Visitor
Filtering error based on two columns
Hi, I have the below dax expression and am trying to filter based on two rows however I get an error with the second filter that states "A Function Filter has been used in a true or false expres...
- 5 years ago
Hi OsmanEmi,
could you change the && to , and try again?
-Crew NA. = CALCULATE(COUNT(FACT_DELIVERY[CREW_QTY]), FILTER(ALL(FACT_DELIVERY[CREW_QTY]),FACT_DELIVERY[CREW_QTY]<2) , FILTER(ALL(FACT_DELIVERY[STOP_TYPE]),FACT_DELIVERY[STOP_TYPE] <> "C"))The && function returns a TRUE or FALSE based on whether the conditions are met. by using the "," instead you are adding another filter to your calculate function, instead of turning it into a TRUE/FALSE.
Best regards,
Tim
tex628
5 years agoCommunity Champion
Hi OsmanEmi ;
You're using the "&&" inbetween two FILTER() statements.
"&&" doesn't work in the way that it says "Do this AND do that".
It basically says "This has to be TRUE and this other thing also has to be TRUE"
Try this instead:
-Crew NA. =
CALCULATE(
COUNT(FACT_DELIVERY[CREW_QTY]) ,
FILTER(ALL(FACT_DELIVERY),FACT_DELIVERY[CREW_QTY]<2 && FACT_DELIVERY[STOP_TYPE] <> "C")
)