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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
banksbc
New Member

Capture Number after finding varying prefix

I am very new to Power Query so forgive my ignorance.  I am trying to capture building numbers in its own column out of trouble ticket descriptions.  The issue is that customers put building number in the description in varying ways.  It can be entered with a "B.1550", "BLDG 1550", or B1550".  In the end I only need to capture "1550" in the building column.

Sample Description(s):

MAC - Data Drop Adds - B. 1550

Need to activate Data Ports in (( BLDG-2061 )) for to double our points of sale at each of the kiosks.

Install rack mounted power bar for network switch in B2655 TR 107



3 REPLIES 3
dufoq3
Super User
Super User

Hi @banksbc ,

try this:

 

Result

dufoq3_0-1711128700490.png

let
    Source = #table(null, {{"B.1550"},{"BLDG 1550"}, {"B1550"}}),
    Ad_ExtractNumbers = Table.AddColumn(Source, "Extract Numbers", each Text.Select([Column1], {"0".."9"}), type text)
in
    Ad_ExtractNumbers

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Thank you Dufoq3,
The issue is the building number varies as shown in the sample descriptions.  Those were listed to show what types of data I am having to parse through.

Hi, my will extract all numbers from that description. If you want to extrat something different, provide expected result based on sample data please. Think in advance which all possible situations you could face and update sample data if needed.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Kudoed Authors