How to Convert Number to Text in Power BI

While working on a Power BI report for a Sales team, one of my colleagues asked me how to convert numbers to text in Power BI.

This was because, in the source data, one column contained both numbers and text values. When this column was used in a chart or visual, Power BI started showing errors, and the report did not work as expected.

In this tutorial, I’ll tell you the different ways to convert numbers to text in Power BI, including:

  • Convert number to text using Power BI DAX
  • Convert number to text using a calculated column in Power BI
  • Convert number to text using Power Query (2 different methods)

Convert Number to Text in Power BI

In this section, we will learn how to convert a number data type to a text data type in Power BI

In this example, we will use the Financials table. The Sales column is currently a decimal number data type, and we will convert it into a text data type in Power BI.

To do this, follow the steps below:

  1. Open the Power BI Desktop and load the Financials data table using the Get Data option. Then click on table view.
dax convert number to text power BI
  1. Next, select the Sales column. Now go to Column tools → Data type to check the current data type of the Sales column, as shown below.
Power BI convert number to text
  1. Now, go to Column tools and select the New column option, as shown below.
Example of Power BI convert number to text
  1. Then add the formula below in the formula bar.
Text value = FORMAT(financials[ Sales], "#")

Where:

  • Text value = New calculated column
  • FORMAT = Function Name
  • financials = Table Name
  • Sales = Column Name
  1. Now, you can see that the new column is created, and its data type is set to Text, as highlighted below.
Power BI convert number to text example

This is how you can convert a number data type to a text data type in Power BI.

Convert Number to Text Datatype using Power BI DAX

Now, let us see how to convert a number data type to a text data type using Power BI DAX functions.

In this example, we will convert the Manufacturing Price column from a whole number data type to a text data type in the data table.

  1. Open Power BI Desktop, load the Financials data, and then go to the Table view.
  2. Select the Manufacturing Price column header -> Column tools -> data type. You can see the datatype.
Power BI convert number to text dax
  1. Now, select the New column option under Column tools. Enter the formula shown below in the formula bar, and then click the check icon.
Text type value = FORMAT(financials[Manufacturing Price], "#")

Where:

  • Text type value = New calculated column
  • FORMAT = Function Name
  • financials = Table Name
  • Manufacturing Price = Column Name
  1. The screenshot below shows the new column, with its data type highlighted as Text.
Power BI convert number to text dax example

This is an example of converting a whole number data type to a text data type using a Power BI measure.

Convert Number to Text Datatype using Calculated Column in Power BI

Here, we will convert a number to a text data type and show the result in a calculated column in Power BI.

In this example, we will convert the Discounts column from a fixed decimal number data type to a text data type in the Financials table.

Follow the steps below:

  1. In Power BI Desktop, go to the Table view. Select the Discounts column header, then go to Column tools -> Data type, as shown below.
Power BI convert number to text calculated column
  1. Now, select the New column option under Column tools. Enter the formula shown below in the formula bar, and then click the check icon.
Text calculated column = FORMAT(financials[Discounts], "#")

Where:

  • Text calculated column = New calculated column
  • FORMAT = Function Name
  • financials = Table Name
  • Discounts = Column Name

In the screenshot below, we can see that the new column displays the Text data type as highlighted below:

Power BI convert number to text format

This is how you can convert a number to a text data type and display the result in a calculated column in Power BI.

Convert Number to Text Datatype using Power BI Power Query

Now, let us see how to convert a number data type to a text data type using the Power Query Editor in Power BI.

Here, I will show you two different ways to convert a number data type to a text data type using the Power Query Editor.

Method 1:

In this example, we use the Financials table data and convert the Units Sold column from a decimal number data type to a text data type.

To do this, follow the steps below:

  1. Load the Financials data table into Power BI Desktop.
power bi dax convert number to text
  1. Under the Home tab, select the Transform Data option, as shown below.
Power query convert number to text example
  1. In the Power query editor, select the units sold column and under the Home tab, expand the Data type option and choose the data type as text, as shown below:
Example of Power query convert number to text
  1. In the screenshot below, you can see that the Units Sold column has been converted from a number data type to a text data type in the Power Query Editor.
power bi dax number to text

This is one way to convert a number to a text data type using the Power Query Editor in Power BI.

Method 2:

In this example, we will use the Financials table and convert the Gross Sales column from a decimal number data type to a text data type.

  1. Open Power BI Desktop and load the data. To check the data type of the Gross Sales column, select the column header, then go to Column tools → Data type, as shown below.
convert the number to text in a column in power query
  1. Select the Transform Data option under the Home tab, as shown below.
Power query convert number to text example
  1. In the Power Query Editor, select the Gross Sales column. Right-click on it, then choose Change Type -> Text, as shown below.
example to convert the number to text in a column in power query

Now, load the data. Go to the Table view and select the Gross Sales column header. Then go to Column tools → Data type, as shown below.

Power query editor convert number to text

Here, you can see that the Gross Sales column data type has been changed to Text.

These are the two different ways to convert a number data type to a text data type using the Power Query Editor in Power BI.

In this tutorial, I covered different ways to convert numbers to text in Power BI. I explained how columns that contain both numeric and text values can cause errors in charts and visuals.

Also, I covered how to convert numbers to text using Power BI DAX, how to display the result using a calculated column, and how to convert numbers to text using Power Query with two different methods.

You may like the following Power BI tutorials:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App