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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
dirkkoch
Helper III
Helper III

Extract number with 10 digits from text column

Dear all,

 

I am struggling to find a way to extract a number from a text column in PBI.

It is a consecutive number which always starts with 2700... and has 10 digits (eg. 2700102524 as shown in Screenshot below marked in red border) .

The number has no fix position within the text field and can be accompanied either with text or numbers before and after appearance. 

The aim is to create an additional column only showing these 10-digit numbers (starting with 2700******) and leaving all other fields blank where no such number can be found. 

Does anyone have an idea how to solve this issue with DAX or Power Query?

 

Text column with numbers.JPG

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@dirkkoch You should be able to do this:

Column =
  VAR __search = SEARCH("2700",[POT1X],0)
RETURN
  IF(__search=0,BLANK(),MID([POT1X],__search,10))

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@dirkkoch You should be able to do this:

Column =
  VAR __search = SEARCH("2700",[POT1X],0)
RETURN
  IF(__search=0,BLANK(),MID([POT1X],__search,10))

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler thanks for the quick support

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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