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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GabsMello
New Member

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 3
Ahmedx
Super User
Super User

pls try this

Screenshot_3.png

AllisonKennedy
Super User
Super User

@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/ 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

rsbin
Super User
Super User

@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,

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.