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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Learner22
Helper I
Helper I

Extract numbers from text

Dear Community,

 

image that the cells in a column contain numbers and string like this D:MNHS 70.29 (Free: 40.23).

How can I extract via for example Power query the numbers 70.29 and 40.23 in two different columns, like

Column A    Column B

70.29            40.23

 

Thank you very much for your help.

2 REPLIES 2
ThxAlot
Super User
Super User

Follow this pattern,

let
    Fx = (txt as text) as list => List.Select(Text.SplitAny(txt,Text.Remove(txt,{"0".."9","."})), each _<>""),

    Source = "D:MNHS 70.29 (Free: 40.23)",
    #"Extracted Num" = Fx(Source)
in
    #"Extracted Num"

ThxAlot_0-1682366450957.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



BA_Pete
Super User
Super User

Hi @Learner22 ,

 

For this specific example, this will work:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcrHy9fMIVjA30DOyVNBwK0pNtVIwAXKMNZViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [text = _t]),

    splitByDelim = Table.SplitColumn(Source, "text", Splitter.SplitTextByEachDelimiter({" ("}, QuoteStyle.Csv, false), {"text1", "text2"}),
    addT1extract =
    Table.AddColumn(
        splitByDelim,
        "text1extract",
        each Text.Select(
            [text1],
            List.Combine({{"0".."9"}, {"."}})
        )
    ),
    addT2extract =
    Table.AddColumn(
        addT1extract,
        "text2extract",
        each Text.Select(
            [text2],
            List.Combine({{"0".."9"}, {"."}})
        )
    )

in
    addT2extract

 

If all the values in your table aren't in the same format (specifically the presence of " (" space open-bracket) then you'll need to provide some more indicative examples to work with.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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