Forum Discussion
Del235
8 months agoHelper III
Advanced filters
I have a list of email addresses. I want to filter out addresses that start with no-email, gmail and sbcglobal. How would I setup the Advanced Filter in Power BI?
- 8 months ago
Hi Del235, where exactly do you want to filter them out? On page level, inside a measure, or in Power Query already?
Power Query:if Text.StartsWith(Text.Lower([Email]), "no-email") or Text.StartsWith(Text.Lower([Email]), "gmail") or Text.StartsWith(Text.Lower([Email]), "sbcglobal") then 0 else 1- You can then either filter the rows in Power Query already for [YourColumnName] = 1 or apply it as a filter via the filter pane after loading it into your model.
DAX (assuming that you literally mean that those should be the first few characters in the column and you know that there won't be any other characters before the parts you're looking for):
IsValidEmail = IF ( LEFT ( LOWER ( 'Table'[Email] ), 8 ) = "no-email" || LEFT ( LOWER ( 'Table'[Email] ), 5 ) = "gmail" || LEFT ( LOWER ( 'Table'[Email] ), 9 ) = "sbcglobal", 0, 1 )
As a Filter in the Filter-Pane:- Switch column to "Advanced filtering" and use "does not start with" (you can drag + drop the same column multiple times into the filter pane to apply it for all three terms
OR - Create a Measure with the DAX-Example above, drag it into the filter pane and filter for IsValidEmail = 1.
- You can then either filter the rows in Power Query already for [YourColumnName] = 1 or apply it as a filter via the filter pane after loading it into your model.
123abc
8 months agoCommunity Champion
If you only want to filter in a visual, do this:
Steps
Select the visual.
Go to the Filters pane → find your Email Address field.
Change filter type to Advanced filtering.
Add these three conditions:
Email Address → does not start with → no-email
Email Address → does not start with → gmail
Email Address → does not start with → sbcglobal
Important
Click "Add filter clause" to add multiple conditions.
Change the logic to AND so that all three exclusions apply.
Your filter will look like:
Field Operator Value| Email Address | does not start with | no-email |
| AND | does not start with | gmail |
| AND | does not start with | sbcglobal |
Let me know if you want to use file anyother way.