Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Phone Number format

Hello,

 

I am trying to create a flag to determine what phones numbers are valid and invalid. The Dax that I'm using accounts for length and for any characters that are not numbers, and it works. However, I need to account for the phone numbers that are formated correctly but are all the same digits. For example : 999-999-9999 or 954-111-1111. Can some one please help me figure out how I can go about this or what can I add to the dax below?

 

Thank you!

 

Phone Number Verifier =
VAR __ValidLen = 12
VAR __Letter = Query1[letter_Symbols]
VAR __PhoneNumber = (Query1[PhoneDashed colum])
RETURN
SWITCH(TRUE(),
LEN(__PhoneNumber) = __ValidLen &&
__Letter = "",
TRUE(),
FALSE()
)
  • Anonymous 

    Try this

     

     

    Please as Accept as Solution if its worked.

3 Replies

  • ddpl's avatar
    ddpl
    Solution Sage

    Anonymous 

    Try this

     

     

    Please as Accept as Solution if its worked.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you for your help!  Unfortunetly, it didn't work for me. The "true" flag also captured numbers that were valid not just the invalid (999-999-9999)

    • v-jingzhang's avatar
      v-jingzhang
      Community Support

      Hi Anonymous 

       

      Do you mean phone numbers like 999-999-9999, 954-111-1111, 999-123-3455 are all invalid phone numbers that should be flagged as False? Can you explain the rules of an invalid phone number while its format is correct? 

       

      Best Regards,
      Community Support Team _ Jing