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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
whitakerj
Regular Visitor

Checking a column for alpha and alpha numeric characters

Hello,

 

I am relatively new to power bi so please be patient. 

 

I am trying to audit data and flag rows that are not all numeric.  

 

Here is a sample of my data 

 

Phone Number

_________________

1234567890

1111111111

123-456-7890

123-789-1230

XXXXXXXXXX

Null

 

I want to be able to create a condition in power bi to find the rows in my data that are not numeric.  When I load the data in power bi  the column is brought in as numeric and the rows that are not numeric result in error.  I would like to be able to display the rows in error so users have a dashboard to know which data rows they need to fix in the system the data is coming from.  I haven't been able to come up with a solution.  Any ideas?

 

 

1 ACCEPTED SOLUTION
waltheed
Impactful Individual
Impactful Individual

You can use the Value function together with IsError.

Like this:

 

IsNum = NOT(ISERROR(VALUE([Phone])))

 

Capture.PNG

 

 

If you want to alow dahes between the numbers you can add a SUBSTITUTE function around the [Phone] field.

 

IsNum = NOT(ISERROR(VALUE(SUBSTITUTE([Phone];"-";""))))

Hope this helps. 

 

Cheers, Edgar Walther
ITsmart BI and Analytics consultant

View solution in original post

3 REPLIES 3
waltheed
Impactful Individual
Impactful Individual

You can use the Value function together with IsError.

Like this:

 

IsNum = NOT(ISERROR(VALUE([Phone])))

 

Capture.PNG

 

 

If you want to alow dahes between the numbers you can add a SUBSTITUTE function around the [Phone] field.

 

IsNum = NOT(ISERROR(VALUE(SUBSTITUTE([Phone];"-";""))))

Hope this helps. 

 

Cheers, Edgar Walther
ITsmart BI and Analytics consultant

Hello,

Thank for the solution :

IsNum = NOT(ISERROR(VALUE([Phone])))

It seems to work most of the time :
NOT(ISERROR(value([ColumnWithLetters]))) gives FALSE.

NOT(ISERROR(value([ColumnWithLeadingZeros]))) gives TRUE.
NOT(ISERROR(value([ColumnWithNULLValue]))) gives FALSE.

 

Unfortunately, it does not work for empty fields (which are not numbers) : 
NOT(ISERROR(value([ColumnWithEmptyValue]))) gives TRUE

NB : NOT(ISERROR(value(""))) works : it gives FALSE.

 

Here is an alternative partial solution (digits from 0 to 9 are encoded from 48 to 57, See https://en.wikipedia.org/wiki/List_of_Unicode_characters#Basic_Latin) : 

IsNum = UNICODE([Phone])>=48) && UNICODE([Phone])<=57

Howerver, this formula tests only the first character of the string : 

https://docs.microsoft.com/en-us/dax/unicode-function-dax

Thank you very much!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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