cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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?

1 ACCEPTED SOLUTION
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))``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
2 REPLIES 2
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))``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Helper III

@Greg_Deckler thanks for the quick support

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors