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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
DMB90
Frequent Visitor

If Text Column Starts with any number, then name the Column something

I have a text string column that begins with 3 numbers followed by letters for some of the items in the column. I want to look for anything in that column that starts with a number and if it does, I want to return a value and if it doesn't start with a number, then I want to return another value.

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

4 REPLIES 4
v-zhengdxu-msft
Community Support
Community Support

Hi @DMB90 

 

Thanks for the reply from @Ahmedx , please allow me to provide another insight:

First of all, I create a set of sample:

vzhengdxumsft_0-1714112655325.png

Then add a calculate column:

Column =
IF ( IFERROR ( VALUE ( MID ( 'Table'[Column1], 1, 3 ) ), 1 ) = 1, "NOT", "YES" )

 The result is as follow:

vzhengdxumsft_1-1714112689858.png

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ahmedx
Super User
Super User

or try this code

Screenshot_2.png

DMB90
Frequent Visitor

Thanks! This worked!

Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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