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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Frequent Visitor

Dax Validation on PAN Data

Hi All,

Can any one help me to write Dax on Validation Of PAN no 

such as It should be 10 --using len()

Pan no consist of strings and Numbers(ie ABCDE1212Q)

first 5 will be string,the next 4 digit will be numbers and the last will be string.


Frequent Visitor

ok ValtteriN

Hi @PooBIDeveloper ,


Has your problem been solved? If it is solved, please mark a reply which is helpful to you.


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,

Super User
Super User

I agree with @ValtteriN. This is possible in DAX but doing it in the query editor instead is much easier, especially if you use RegEx.

Super User
Super User


I wouldn't really do this in DAX since it is not really efficient to test datatypes within a string. For LEN you can used LEN but for mixed datatype things become a bit tricky. You could split your column by lenght in PQ and test the datatypes out of these new columns.

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


I have tried the below dax but its shows only output as Invalid ..

pan_val =
VAR _Condition =
(master_customer[LenPan] <= 10)
&& ISTEXT ( master_customer[First Characters] )
&& ISTEXT ( master_customer[Last Characters] )
&& ISNUMBER ( master_customer[Text Range] )
IF ( _Condition, "Valid", "Invalid" )

Helpful resources

Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City


Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors