Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
DouweMeer
Impactful Individual
Impactful Individual

Order in which filter works

Was wondering how filter works in Power BI from evaluating a context's records. 

If you have this:

Filter ( 'table'
 , boolean 1
 && boolean 2
 && boolean 3
 )

Will it by default work like this:

 

DouweMeer_0-1739287990420.png

Or like this?

 

DouweMeer_1-1739288003819.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @DouweMeer 

The logical operator && follows the short-circuit evaluation rule. If multiple conditions are connected by && (e.g., A&&B&&C&&D), once any condition returns FALSE, the subsequent conditions will no longer be evaluated, and FALSE will be returned immediately.

 

You can verify the short-circuit property using the following formula:

Test = 
IF (
    TRUE() && FALSE() && DIVIDE(1, 0),  
// Without short-circuiting, DIVIDE(1,0) would result in an error (division by zero error).
    "True",
    "False"
)

 

vjialongymsft_0-1739342782424.png

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @DouweMeer 

The logical operator && follows the short-circuit evaluation rule. If multiple conditions are connected by && (e.g., A&&B&&C&&D), once any condition returns FALSE, the subsequent conditions will no longer be evaluated, and FALSE will be returned immediately.

 

You can verify the short-circuit property using the following formula:

Test = 
IF (
    TRUE() && FALSE() && DIVIDE(1, 0),  
// Without short-circuiting, DIVIDE(1,0) would result in an error (division by zero error).
    "True",
    "False"
)

 

vjialongymsft_0-1739342782424.png

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

DouweMeer
Impactful Individual
Impactful Individual

I like your thought, but did you try to remove the false to test whether it returns in an error? 

 

DouweMeer_0-1740133212434.png

 

It doesn't :). Probably due to the divide expression on alternative result.

 

Which doesn't mean your assumption is false, just your argumentation is incorrect. 

 

DouweMeer_1-1740133301886.png

 

Versus

 

DouweMeer_2-1740133327805.png

 

Thanks.

 

 

rajendraongole1
Super User
Super User

Hi @DouweMeer  - In Power BI, you can apply the filters n daz as follows

 

FILTER ( 'table', 'table'[Boolean 1] && 'table'[Boolean 2] && 'table'[Boolean 3] )

This means that only rows where all three Boolean columns are TRUE will be returned.The correct filter result should only return Record 4, since it is the only row where all three Boolean values are TRUE.
So the filtering should work like neither image exactly but should result in a single-row table with only Record 4.

 

Hope this works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





That was not the question. The question is not which record would return. 

 

The question is how the boolean expressions are evaluated in the table. If boolean 1 would return false, would it even try to evaluate boolean 2 and boolean 3? Or would it go to the next record without verifying the second one? 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.