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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Is number not working

Hi I have a field with the following data

 

CNG Rubicon remnant master campaign ongoing
32185184 SANDYSIKE BUILDERS MERCHANTS
Simon Huntington Jan - May 16 CN NS 4000pw
MF021929-64 Specsavers Q1 30/3-4/7/16
Teads Mediaforce Ongoing Flights
Troubleshooting
32308127 THOMAS FORSYTH
Amazon Feb 2015 Onwards
Magazine Standing House Ad Oct 2015 to Dec 2016
32211716 Valentines Promo West ad
CNG Rubicon remnant master campaign ongoing
Kirkgate Comedy up to Feb 19th
32217405 CARTMEL RACECOURSE

 

and I am wanting to say if the first 8 numbers isNumber then do something. The problem is it seems to not like it due to it trying to get the value from a text column and is throwing up errors.... Any ideas.

 

Thanks

 

C

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

@Anonymous

 

According to your description, I made a sample for your reference.

 

I assume you have table called MyTestTable like below.

testtable.PNG

In this scenario, you can use VALUE() function to determine if the 8 character can be converted into number, then using ISERROR() as condition in  IF() statement. Please refer to formula below:

Column2 = IF ( ISERROR ( VALUE ( LEFT ( MyTestTable[Column1], 8 ) ) ), "False", "isNumber" )

r2.PNG

Regards

View solution in original post

3 REPLIES 3
v-ljerr-msft
Microsoft Employee
Microsoft Employee

@Anonymous

 

According to your description, I made a sample for your reference.

 

I assume you have table called MyTestTable like below.

testtable.PNG

In this scenario, you can use VALUE() function to determine if the 8 character can be converted into number, then using ISERROR() as condition in  IF() statement. Please refer to formula below:

Column2 = IF ( ISERROR ( VALUE ( LEFT ( MyTestTable[Column1], 8 ) ) ), "False", "isNumber" )

r2.PNG

Regards

Anonymous
Not applicable

Working 🙂

CahabaData
Memorable Member
Memorable Member

that field is fundamentally a text field - so a simple IsNumber will not work I don't think, and I guess as you have found.

 

If you have to get all 8 digits then I believe you would need to make a calculated column using LEFT to isolate those values into a new field....  just off the cuff I am guessing you are going to have to put together a SWITCH (or IF) that looks at the 1 position for 0,1,2,3,4,5,6,7,8,9 so that only those get the moved to the new calculated column......because of course you can't have any text in there.....

 

But maybe that single digit SWITCH check alone could suffice for what you want perhaps - not sure......

 

I have seen dialog regarding other products that do recast on the fly - but I've never seen it in this product set....  will be interested to see if there is another way...

 

 

 

www.CahabaData.com

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors