Power Query: Extract Numbers from a Text String
- MirVel

- Mar 13, 2025
- 1 min read
Updated: Feb 24
PRACTICE MATERIAL BELOW!👇
Function: Extracts only the numeric values from a given text. Simply add custom function in Power Query and define your column.

Usage:
= ExtractNumbers("Order ID: 123ABC456") → Returns: "123456"Power Query code for use and reuse:
let
ExtractNumbers = (inputText as nullable text) as nullable text =>
let
NumbersOnly =
if inputText = null then null
else Text.Select(inputText, {"0".."9"})
in
NumbersOnly
in
ExtractNumbers

Need a code and instructions? Free of charge =)





Comments