Forum Discussion

DouweMeer's avatar
DouweMeer
Icon for Impactful Individual rankImpactful Individual
1 year ago
Solved

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:...
  • Anonymous's avatar
    Anonymous
    1 year ago

    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"
    )

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

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