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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
adavid999
Helper V
Helper V

dax filtering

Hello, 

 

please can someone help me understand why these two filters produce slightly different results (I would have thought they are doing the same job but I am obviously misunderstanding something)?

 

filter 1 =
CALCULATE (
    COUNT ( table2[id] ),
    table2[gender] >= 1
        && table2[gender] <= 3
        && table2[zone] >= 5
        && table2[zone] <= 8
)

 

filter 2 =
CALCULATE (
    COUNT ( table2[id] ),
    table2[gender] >= 1
        && table2[gender] <= 3
        && table2[zone] == 5
        || table2[zone] == 6
        || table2[zone] == 7
        || table2[zone] == 8
)

Thanks,

A

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@adavid999 

 

you are doing a strict comparison using ==, so the condition is true when both sides are equal or blank.

 

please refer to this article: https://dax.guide/op/strictly-equal-to/

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
adavid999
Helper V
Helper V

@Fowmy got it, and thanks for the link

Fowmy
Super User
Super User

@adavid999 

 

you are doing a strict comparison using ==, so the condition is true when both sides are equal or blank.

 

please refer to this article: https://dax.guide/op/strictly-equal-to/

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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