Forum Discussion

GabsMello's avatar
GabsMello
New Member
2 years ago

Pattern search

Dear friends,

I have a data that contains a column:
0000_AA_00000

Where 0 can be any number (0 to 9) and A can be any letter (A to Z)

But this can be anywhere in the row

We can have
text 0000_AA_00000 text
text
0000_AA_00000AAAAAA text

a lot of formats, I need to search the pattern and give a result that the row is true or not in another column

 

tkss guyss

3 Replies

  • rsbin's avatar
    rsbin
    Community Champion

    GabsMello ,

    Power Query has a number of different Text functions you can use to clean up and remove unwanted characters.

    Based on the sample you provided, I have done up a sample pbix attached.

    Hoping this solution will resolve the majority of your various cases.  But if not, you can use the various options provided to "clean" the column to arrive at the desired Pattern.

    Hope this at least gets you started and you can see the logic.  Let me know if you have any questions.

    Regards,

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    GabsMello  If the Power Query solution provided by rsbin works - that's great and preferred to DAX. I haven't downloaded the file but it should be possible, my Power Query just isn't as strong as my DAX.

     

    If not, DAX also has some text functions you can use to search for the underscore _ and then keep the characters to the left and right of these. Then you can check if they're numeric or not.

     

    https://dax.guide/functions/text/