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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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()
)
1 ACCEPTED SOLUTION
ddpl
Solution Sage
Solution Sage

@Anonymous 

Try this

 

ddpl_0-1656754730545.png

 

Please as Accept as Solution if its worked.

View solution in original post

3 REPLIES 3
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)

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

ddpl
Solution Sage
Solution Sage

@Anonymous 

Try this

 

ddpl_0-1656754730545.png

 

Please as Accept as Solution if its worked.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.