Forum Discussion
Advanced filters
- 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.
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 report
Steps
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).
Thanks
Haish K
If I resolve your issue. Kindly give kudos to this post and accept it as a solution so other can refer this.