Forum Discussion

yel4h's avatar
yel4h
New Member
11 months ago
Solved

[DAX] Dynamic way to get numeric values [0..9] from string with no pattern.

Hey, I have been wanting to make a DAX expression to solve this for a while. I saw a lot of others also struggle to do this with DAX and would have to use Power Query to solve. The following code...
  • yel4h's avatar
    yel4h
    11 months ago

    You are totally correct, I had comeback from a meeting and had forgot to change the code to refer to the virtual colum I created with addcolumn. 


    My intial test which works but can become concumption heavy, esp when strings are lenghty: 

    CONCATENATEX (
        FILTER (
            GENERATESERIES(1, LEN(txt)),
            MID(txt, [Value], 1) >= "0" &&
            MID(txt, [Value], 1) <= "9"
        ),
        MID(txt, [Value], 1),
        ""
    )