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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

If column of type text contains a specific value

Hi Everyone,

 

I am trying to figure out the following problem: I have a column A of type text with both words and numbers. I would like to create a new column B where I only return from column A the text which includes the numbers 0,1,2.....9. 

Can anyone help me out?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Ok then you can try this.

 

1.

 

 

Text.Select([Column1], {"0".."9"})

 

 

2.

 

 

Text.Select([Column1], {"A".."Z"})

 

 

3.

Filter the Row with the letters (null) Then you should get what you want

 

 

PeterSch_0-1626694831170.png

 ->

PeterSch_1-1626694853606.png

 

 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

This is quite helpful, thank you. However, in my example column, I have rows either with text and numbers or rows with only numbers and I would like to extract only the rows which contain numbers and ignore the ones where there's a mix between text and numbers (there can appear a blank space). I would be very grateful if you could help me. Best regards

 

Hey nore755, you can try something like this

 

if (Value.Is([Column1], Int64.Type)) then [Column1] else ""

  This give me just the Numbers.

 

PeterSch_0-1626679951079.png

 

I hope that work for you.

 

Anonymous
Not applicable

I tried this but I have noticed this solution does not work for me, because my column type is text, which I cannot convert. I was try something like this, but I am getting errors:


If text.contains (columnA,"0")  then columnA

else if text.contains (columnA,"1")  then columnA

else if text.contains (columnA,"2")  then columnA

...

else ""

 

It would be of great help!

Ok then you can try this.

 

1.

 

 

Text.Select([Column1], {"0".."9"})

 

 

2.

 

 

Text.Select([Column1], {"A".."Z"})

 

 

3.

Filter the Row with the letters (null) Then you should get what you want

 

 

PeterSch_0-1626694831170.png

 ->

PeterSch_1-1626694853606.png

 

 

 

Anonymous
Not applicable

Thank you very much for your help, much appreciated!!

PeterSch
Frequent Visitor

Maybe this will help you.

 

There it is solved in Power Query.

 

https://community.powerbi.com/t5/Desktop/NEED-HELP-FOR-EXTRACT-ONLY-NUMBERS/td-p/270983

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors