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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

0

Filter Rows using Advanced condition - 'does not equal' logic is counter intuitive (AND/OR operator)

I was trying to filter the data using advanced condition, the logic seems to be working fine for AND opearator but not for OR. This seems to be counter intuitive from the way UI is used. 

 

For Ex: I have data, one of the column is country. I am trying to exclude the data where country is Canada or USA. For that, when I use UI 

ramschem4u_0-1644277496292.png

does not do anything and these counties are still included in the data. 

 

But, when I do the other way, using AND operator, the filter gets applied and rows for Canada and USA are ignored. 

 

ramschem4u_1-1644277580922.png

I feel this is counter intuitive, as one cell can have Canada or USA as country. So, the logic with OR operator makes sense. 

 

Status: Delivered

I understand your idea because we usually say that in our lives and it sounds like correct but from a computational logic, OR operator is strictly defined.

 

OR operator means if one of the logic is TRUE, the result would be TRUE.

 

In this case, you have defined the logic [Country] <> "Canada" or [Country] <> "United States of America", for Canada field, it meets [Country] <> "United States of America" so that it would return TRUE; same as United States of America field, it meets [Country] <> "Canada" so that it would also return TRUE.

 

Hopes it would help.

 

Best Regards,
Community Support Team _ Yingjie Li

Comments
v-yingjl
Community Support
Status changed to: Delivered

I understand your idea because we usually say that in our lives and it sounds like correct but from a computational logic, OR operator is strictly defined.

 

OR operator means if one of the logic is TRUE, the result would be TRUE.

 

In this case, you have defined the logic [Country] <> "Canada" or [Country] <> "United States of America", for Canada field, it meets [Country] <> "United States of America" so that it would return TRUE; same as United States of America field, it meets [Country] <> "Canada" so that it would also return TRUE.

 

Hopes it would help.

 

Best Regards,
Community Support Team _ Yingjie Li

ramschem4u
Microsoft Employee

Makes sense from computational point, thank you.