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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Heinrich
Post Patron
Post Patron

Filters: Exclude Numbers

Hello

Is it possible to exclude numbers or only contain letters in a filter.

Power_BI_contains_only_letters.png

Regards

Heinrich

2 ACCEPTED SOLUTIONS
d_rohlfs
Helper I
Helper I

Hi @Heinrich

You could create a calculated column that is 

Text Check = IF(ISERROR(VALUE('Table1'[Field 1])), "TEXT", "NUMBER")
Then place this into a a filter and you can choose to filter out rows where the entire cell content for that row is a number.

View solution in original post

Hi @Heinrich  so, either take my first solution, there are 10 possible numbers that any number can start with and in advanced filtering say starts with instead of equals or contains. 

Or create a Calculated Column 

VizFilter =
if(left(Table[YourColumn], 1)
in {"1","2","3","4", "5", "6", "7", "8", "9", "0"}, 1, 0)

Use it as a filter.

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

13 REPLIES 13
d_rohlfs
Helper I
Helper I

Hi @Heinrich

You could create a calculated column that is 

Text Check = IF(ISERROR(VALUE('Table1'[Field 1])), "TEXT", "NUMBER")
Then place this into a a filter and you can choose to filter out rows where the entire cell content for that row is a number.

Hello d_rohlfs

Thank you very much.

With "Number" do you mean a specific number or is this a variable?
I can not tell you the number exactly.

Regards

Heinrich

kpost
Super User
Super User

A similar solution to @olgad but this moves the logic into a measure instead, and works for some kinds of visuals.

Create a measure like this:

visualFilter = 
IF(

CONTAINSSTRING([value], "0")
|| CONTAINSSTRING([value], "1")
|| CONTAINSSTRING([value], "2")

|| CONTAINSSTRING([value], "3")

|| CONTAINSSTRING([value], "4")

|| CONTAINSSTRING([value], "5")

|| CONTAINSSTRING([value], "6")

|| CONTAINSSTRING([value], "7")

|| CONTAINSSTRING([value], "8")

|| CONTAINSSTRING([value], "9"),

 

1,

 

0

)

 

Then make this measure a filter on the visual and only include records where [visualFilter] is 0

Hello kpost

Thank you but there are multiple digits so one single number is to few.

Do you have the possibility to expand this solution?
Regards
Heinrich

My solution filters on whether there are ANY numbers, anywhere in the field.  It is not checking whether the field is equal to 0,1,2,3,4,5,6,7,8,9.  Rather, it is checking whether those characters are found anywhere in the string.

Thank you @kpost 
It was my error. I wanted to filter out every name that starts with a number
Do you have such a solution
Regards
Heinrich

@olgad  nailed it.

 

If the filter condition is that you want to exclude names that start with a number, rather than names that contain a number then use:

 

if(left(Table[YourColumn], 1)
in {"1","2","3","4""5""6""7""8""9""0"}, 10)

 

rather than CONTAINSSTRING. 

 

then use that as a filter on the visual and do a 'basic' filter on fields where it equals zero.

Hello @kpost 

Thank you very much.

Enjoy the weekend

Regards

Heinrich

Hi @Heinrich  so, either take my first solution, there are 10 possible numbers that any number can start with and in advanced filtering say starts with instead of equals or contains. 

Or create a Calculated Column 

VizFilter =
if(left(Table[YourColumn], 1)
in {"1","2","3","4", "5", "6", "7", "8", "9", "0"}, 1, 0)

Use it as a filter.

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Hi @olgad 

Thank you very much.

Have a great weekend.

Regards

Heinrich

Please @Heinrich dont forget to accept the solution that helped you solve the problem. Thanks, have a greate one too. 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
olgad
Super User
Super User

A dirty solution, but nonetheless:
In the filter, you choose filter type: basic, deselct everything, pick 10 entries

olgad_0-1712075421361.png

Then, change the filter type to Advanced: 

olgad_1-1712075509448.png

Change "is" to "does not contain"  and put in 0,1,2,3,4,5 etc. and apply filter


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Hello olgad

Thank you but there are multiple digits so one single number is to few.

Do you have the possibility to expand this solution?
Regards
Heinrich

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.