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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Resolver I
Resolver 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
Resolver I
Resolver 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.