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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Formatting phone numbers (remove both hyphen and parenthesis)

For my report, I need to format my phone numbers in a way different than a lot of other people - I need the dashes and parentheses removed from the numbers currently being displayed.

Currently, my phone numbers are formatted as (999)999-9999 or 999-999-9999.

I need them to just say 9999999999. 

I used the substitute function to remove the -, which worked, but am having a lot of trouble when it comes to removing either of the parenthesis as DAX sees this as my trying to execute another function. Does anyone have any suggestions that will allow me to remove both the - and the () in phone numbers? 

3 REPLIES 3
Anonymous
Not applicable

This is the current formual I have been using: 

Customer Phone = SUBSTITUTE(Substitute('Report'[Customer Phone], "-", ""), "(","")

@Anonymous , why bother to format string with DAX? Power Query is born for such tasks,

Text.Select("Any String", {"0".."9"})

Screenshot 2021-03-04 233843.png


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!

Anonymous
Not applicable

Thank you, but unfortunately due to the nature of the data being used, I do not have access to the SQL server that would allow me to transform the data. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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