Forum Discussion
PooBIDeveloper
4 years agoFrequent 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 digi...
ValtteriN
Community Champion
4 years agoHi,
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.
PooBIDeveloper
4 years agoFrequent Visitor
Hi...
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] )
RETURN
IF ( _Condition, "Valid", "Invalid" )