Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 expression"
Can someone explain to me the logic behind what im doing and why it's wrong.
Below is my dax measure
Crew_qty | stop_type |
1 | c |
1 | a |
2 | a |
3 | a |
Solved! Go to Solution.
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
Proud to be a Super User!
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")
)
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
Proud to be a Super User!
Hi timg,
This worked thank you very much.
Is it possible to explain why this worked as opposed to my method?
Hi Osman,
I included an explanation as an edit in my first reply just now. Does this clarify the difference sufficiently?
Best regards,
Tim
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
63 | |
53 | |
39 | |
25 |
User | Count |
---|---|
85 | |
57 | |
45 | |
43 | |
38 |