In this article, we will learn how we can apply formatting to a phone number column in Power BI.
I have used an approach of a calculated column with FORMAT() DAX expression.
At the end of the article, we will convert the phone number format like this. I also have uploaded sample files for your practice.
Now, let's elaborate.
Convert Text Datatype to Whole Number Datatype
Most of us have “Text” Datatype with the column "Phone Number" in Power BI. The first step is, to convert this "Text" data type to "Whole Number".
To convert "Text" datatype to "Whole Number" follow the below steps.
Select the Column and Go to Modelling Tab.
From Datatype, select the Whole Number.
Apply DAX Expression
Now, let’s create one calculated column,
I have used the following DAX Expression to format the Phone Number. FormattedPhoneNumber = FORMAT(Sheet1[Phone Number],"###-###-####")
Now, let’s elaborate on this function in detail.
Syntax FORMAT(VALUE, FORMAT)
Here, Value = Name of the column
Format= Format for the Phone Number
Now, we are able to Format the Phone Number like this,
Let’s apply it to our table and here is the result!
This is how we can format a Phone Number in Power BI. Isn’t it easy?