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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Ethanhunt123
Helper IV
Helper IV

Dax to check alphanumric string

I need to write DAX to check the alphanumeric string.  I know how to check the numeric string (ISNUM) but I think DAX are case sensitive so I am not sure how can I check alphanumeric string? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ethanhunt123 ,

 

You can use SWITCH() function to check.

Column =
SWITCH (
    [Column1],
    "a1", TRUE (),
    "a2", TRUE (),
    "a3", FALSE (),
    "a4", FALSE ()
)

26.png

 

Or, there is a workaround. You could create a keyword table (including the number of letters), and then refer to the link below to create a formula. Please refer to:

DAX – “CONTAINSX” – Finding if a value in table 1 has a matching value in table 2

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @Ethanhunt123 ,


Sorry to disturb you...


But did I answer your question ? Please mark my reply as solution. Thank you very much.

 

Best Regards,
Stephen Tao

Anonymous
Not applicable

Hi @Ethanhunt123 ,

 

You can use SWITCH() function to check.

Column =
SWITCH (
    [Column1],
    "a1", TRUE (),
    "a2", TRUE (),
    "a3", FALSE (),
    "a4", FALSE ()
)

26.png

 

Or, there is a workaround. You could create a keyword table (including the number of letters), and then refer to the link below to create a formula. Please refer to:

DAX – “CONTAINSX” – Finding if a value in table 1 has a matching value in table 2

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

CNENFRNL
Community Champion
Community Champion

@Ethanhunt123 , on the contrary, DAX isn't case-sensitive even if you use strict equal to (==) operator; but "==" does distinguish BLANK() from 0 or "".

Screenshot 2021-01-07 162418.png

 

You might want to turn to Power Query for such case-sensitiveness tests.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

amitchandak
Super User
Super User

@Ethanhunt123 , refer this old solution

https://community.powerbi.com/t5/Desktop/Checking-a-column-for-alpha-and-alpha-numeric-characters/td...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  This old solution is how to check numeric string. I need to check alphanumeric string

littlemojopuppy
Community Champion
Community Champion

What are you trying to check?  That it is/is not numeric or that it contains something?

@littlemojopuppy  I need to check alphanumeric strings

Check for what?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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