How to Convert Decimal to Text in Power BI

In this Power Bi tutorial, We will discuss how to convert Decimal to Text in Power BI. In addition, we will also discuss how to convert Decimal to Text using the Power Query editor in Power BI.

Convert Decimal to Text in Power BI

Here we will see how to convert the Decimal data type to text data type in Power Bi,

Yes, it is possible to convert the Decimal data type to a text data type in Power BI.

We will use the financials data table in this example, to convert the Units Sold column which is of decimal data type to the text data type in Power Bi.

To achieve this, follow the below-mentioned steps:

  • Load the financials data table into the Power Bi desktop using the get data option. Once the data has been loaded, check the Units Sold column data type by selecting the Units Sold column header, Column tools – > data type as highlighted below:
Power BI convert Decimal to Text
Power BI convert Decimal to Text

Now click on the column tools -> new column option as shown below:

Power BI convert Decimal to Text example
Power BI converts Decimal to Text example
  • And use the below-mentioned formula in the formula bar to convert the decimal to text data type and click on the check icon.
Decimal to Text value = FORMAT(financials[Units Sold],"#")

Where,

  1. Decimal to Text value  = New calculated column
  2. FORMAT = Function Name
  3. financials = Table Name
  4. Units Sold = Existing Column Name
  • In the below screenshot, we can see that the newly created calculated column displays the Text data type as highlighted below:
Example of Power BI convert Decimal to Text
Example of Power BI convert Decimal to Text

This is how to convert the Decimal data type to the text data type in Power Bi.

See also  How to add a column with a dropdown list in Power Query

Also, Read: How to Convert Text to Number in Power BI

Power Query Convert Decimal to Text

Let us see how we can convert the decimal data type to a text data type using the Power query editor in Power Bi.

Yes, there are two different approaches that we can convert the decimal type to text type using the power query editor. In the following, I have explained the two different ways to achieve it.

Approach 1:

In this example, we use the financials table data, and we convert the sales column which consists of the decimal data type, we will convert it to the text data type.

Follow the below steps to achieve it:

Load the data source into the Power Bi desktop, and to check the sales column data type, select the sales column header -> Column tools – > data type as displayed below:

Power Query Convert Decimal to Text
Power Query Convert Decimal to Text

Under the Home tab select the transform data option as highlighted below, it will automatically redirect to the Power Query editor.

Power Query Convert Decimal to Text example
Power Query Convert Decimal to Text example

In the Power query editor, select the sales column, and under the Home tab, expand the Data type option and choose the data type as Text data type as shown below:

Convert Decimal to Text using Power Query
Convert Decimal to Text using Power Query

Once the data type has been selected as a text type, it will be automatically converted to the text data type from the decimal data type for the selected sales column.

= Table.TransformColumnTypes(#"Changed Type",{{" Sales", type text}})
  • In the below screenshot, you can see that the sales column has been converted from the decimal data type to the text data type in the Power Query editor.
  • Click on the Home-> Close and Apply option, so that the changes will be reflected on the Power Bi desktop.
Convert Decimal to Text using Power Query example
Convert Decimal to Text using Power Query example
  • To check the sales column data type in Power BI, select the sales column header -> Column tools – > data type as displayed below:
  • Here we can see the changes have been reflected, and for the sales column data type has been converted to a text data type.
Example of Convert Decimal to Text using Power Query
Example of Convert Decimal to Text using Power Query

This is one approach to converting the decimal to a text data type using the Power Query editor in Power Bi.

See also  How to add a column with the same value in Power BI

Check out: How to Convert Number to Text in Power BI [With Leading Zeros]

Approach 2:

Now let us discuss the second approach, and we will use the financials table data, and we convert the discounts column which consists of decimal data type to the text data type.

Open the Power Bi desktop and load data into it, and to check the discounts column data type, select the discounts column header -> Column tools – > data type as displayed below:

Power BI Convert decimal number to text in Power BI
Power BI Convert decimal to text in Power BI
  • select the Home -> transform data option and it will automatically redirect to the Power Query editor.
  • In the Power query editor, select and Right click on the Discounts column -> Change Type -> Text option as illustrated below:
Power BI Convert decimal numbers to text in Power BI example
Power BI Convert decimal to text in Power BI example

Once the data type has been changed to the text data type, it will be automatically converted from the decimal data type to the text data type for the selected discounts column.

= Table.TransformColumnTypes(#"Changed Type",{{" Sales", type text}, {"Discounts", type text}})
  • In the below screenshot, you can see that the discounts column has been converted from the decimal data type to the text data type in the Power Query editor.
  • Click on the Close and Apply option, so that the changes will be reflected on the Power Bi desktop.
Example of Converting decimal number to text in Power BI
Example of Converting a decimal to text in Power BI

This is another approach to converting the decimal to text using the Power Query editor in Power Bi.

These are the two different approaches that to convert the decimal data type to text data type using the Power query editor in Power Bi.

See also  How to Sync Slicers in Power BI? [With Examples]

Moreover, you may like some more Power BI tutorials:

In this Power Bi tutorial, We have discussed how to convert Decimal to Text in Power BI. In addition, we also covered how to convert Decimal to Text using the Power Query editor in Power BI.

>