Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

Text by number

Hello

I have a text column, in which there are numbers and text.

I would like to create another column or measure, in which you convert the numbers (which are now text) to "number", and ignore the rows of text

With VALUE it doesn't work for me

Thanks a lot

Column (text)Column 2 (Number)
20192019
20202020
XCXC

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Syndicate_Admin Here is a Power Query solution as well:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtFSK1QExjAzAjAjnCGel2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column (text)" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column (text)", Int64.Type}}),
        #"Replaced Errors" = Table.ReplaceErrorValues(#"Changed Type", {{"Column (text)", null}})
    in
        #"Replaced Errors"