Forum Discussion
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?
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.
10 Replies
- KarinSzilagyiSuper User
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.
- 123abcCommunity 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-emailEmail Address → does not start with → gmailEmail Address → does not start with → sbcglobalImportant
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 ValueEmail 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.
- MasonMASuper User
Hi,
You can also build a Column to filter them out and this would be simpler way for maintenance in future.
IsValid =VAR _e = LOWER ( TRIM ( Table1[Email] ) )RETURNNOT (LEFT(_e, 8) = "no-email"|| LEFT(_e, 5) = "gmail"|| LEFT(_e, 9) = "sbcglobal") - Murtaza_GhafoorSuper User
If you have email column then simply
Select Email and then go to advance filtering
select email starts with
no-email,does not begin with no-email
AND
does not begin with gmail
AND
does not begin with sbcglobal
gmail
sbcglobal - Shubham_rai955Super User
Use Advanced filtering on your Email column and stack three “does not start with” conditions combined with AND.
Setup:
Put Email field in the Filters pane (visual, page, or report level).
Choose Advanced filtering.
Add three rules:
“does not start with” → no-email
“does not start with” → gmail
“does not start with” → sbcglobal
Make sure the logical operator between them is AND
- krishnakanth240Super User
Hi Del235
> Option 1: Advanced Filter (Recommended – No DAX)
Select your Table / Visual
Go to the Filters pane
Drag the Email Address column into Filters on this visual
Change filter type to Advanced filtering
Set conditions as:
Show items when value:
does not start with no-email
AND
does not start with gmail
AND
does not start with sbcglobal
📌Make sure you use AND, not OR
📌This keeps only emails that do not start with those values✔ Example:
[email protected]
[email protected]x Example removed:
[email protected]
[email protected]
[email protected]> Option 2: DAX Calculated Column (More Control)
Use this if you want the logic reusable across visuals.
Valid Email =
IF (
LEFT ( LOWER ( Table[Email] ), 8 ) = "no-email"
|| LEFT ( LOWER ( Table[Email] ), 5 ) = "gmail"
|| LEFT ( LOWER ( Table[Email] ), 9 ) = "sbcglobal",
"Exclude",
"Include"
)
Then filter:Valid Email = Include
> Option 3: Power Query (Best for Large Datasets)
Open Transform Data
Select Email column
Filter → Text Filters → Does Not Begin With
Apply three filters:
does not begin with no-email
does not begin with gmail
does not begin with sbcglobal
Power Query is best for performance and data cleansing
Please give headsup / mark it as a solution once it is comepleted. Thank You!
- SavioFerrazSuper User
Hi Del235 ,
This can be done cleanly in Power BI, and the best approach depends on whether you want it at data-load time or report-interaction time.
✅ Recommended approach (Power Query – best practice)
If these emails should always be excluded, do this in Power Query.
Steps
Open Transform data
Select the column with the email addresses
Go to Home → Filter → Text Filters → Does Not Begin With
Add the following conditions:
does not begin with no-email
does not begin with gmail
does not begin with sbcglobal
Combine them using AND
This permanently removes those records from the model.
Equivalent M code
= Table.SelectRows(
Source,
each not (
Text.StartsWith([Email], "no-email")
or Text.StartsWith([Email], "gmail")
or Text.StartsWith([Email], "sbcglobal")
)
)🔁 Alternative: Advanced Filter in the report (no data removal)
If you want to keep the data but filter it visually:
Select the visual
Go to the Filters pane
Add the Email field
Choose Advanced filtering
Configure:
does not begin with no-email
AND does not begin with gmail
AND does not begin with sbcglobal
This affects only the visual or page, not the dataset.
❌ What not to do
Avoid using CONTAINS or SEARCH for this case
Avoid creating calculated columns unless absolutely necessary
Don’t rely on slicers for exclusion logic like this
Conceptual illustration
Email List
├── [email protected] ❌ filtered out
├── [email protected] ❌ filtered out
├── sbcglobal_user@... ❌ filtered out
└── [email protected] ✅ keptSummary
✔ Use Power Query if the rule is permanent
✔ Use Advanced Filters if it’s report-level logic
✔ Use Does Not Begin With + AND conditionsIf this helped, please consider giving a kudos 👍
And if it solved your problem, feel free to mark this as the Accepted Answer ✔ - v-aatheequeCommunity Support
Hi Del235
Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further.- v-aatheequeCommunity Support
Hi Del235
Have you had a chance to look through the responses shared earlier? If anything is still unclear, we’ll be happy to provide additional support.
- HarishKMSuper User
Del235 Hey,
Visual-level filter: applies to one visual
- Page-level filter: applies to all visuals on the page
- Report-level filter: applies to the entire reportSteps
1) Drag your Email field into the Filters pane (at the desired scope).
2) Change the filter type to Advanced filtering.
3) Set the condition group to And.
4) Add these clauses:
- does not start with → no-email
- does not start with → gmail
- does not start with → sbcglobal
5) (Optional) Add is not blank to exclude blanks.Notes and tips
- The text match is case-insensitive. If you have leading spaces in the data, trim them in Power Query (Transform > Format > Trim/Clean).
- If what you actually mean is to exclude Gmail/SBCGlobal by domain, use:
- does not end with → @gmail.com
- does not end with → @sbcglobal.net
or use does not contain with those domain endings.This will filter out any email addresses that begin with those strings (or those domains, if you use the alternative).
ThanksHaish K
If I resolve your issue. Kindly give kudos to this post and accept it as a solution so other can refer this.