Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello,
I am having trouble understanding the Power BI logic in a case where I want to remove BLANK and "UNKNOWN" product names from a matrix visual. This only works if I set the advanced filtering for ProductName to: is not blank AND is not "UNKNOWN", which is completely different from the logic in SQL (ProductName IS NOT NULL OR ProductName != 'UNKNOWN').
I just can't wrap my head around this. Could someone please explain why this works like it does.
Solved! Go to Solution.
The OR logic doesn't make sense to me. All values are either not null or not unknown because they can't be both at the same time.
By DeMorgan's law,
(P is not NULL or P is not UNKNOWN)
is logically equivalent to
not (P is NULL and P is UNKNOWN)
This always returns true since P cannot have multiple values simultaneously.
The OR logic doesn't make sense to me. All values are either not null or not unknown because they can't be both at the same time.
By DeMorgan's law,
(P is not NULL or P is not UNKNOWN)
is logically equivalent to
not (P is NULL and P is UNKNOWN)
This always returns true since P cannot have multiple values simultaneously.
Absolutely got the entire thing wrong in my head. Thanks!
The SQL I wrote is wrong, it is supposed to be: ProductName IS NOT NULL AND ProductName != 'UNKNOWN'
Hi @Hubblet -Power BI's filter pane combines conditions with AND, meaning all specified conditions must be met for data to be included in a visual. This is different from SQL’s "OR" logic, but understanding this distinction allows you to apply the correct filters in Power BI to get the desired results.
Example:
ProductName is not blank
ProductName is not "UNKNOWN"
Hope it helps
Proud to be a Super User! | |