Power BI convert text to number


Data types
Operators
Statements  

Converts a text string that represents a number to a number.

Parameter Attributes Description
Text

The text to be converted.

Scalar A single decimal value.

The converted number in decimal data type.

-- VALUE converts a text string that represents a number to a number. EVALUATE { ( "INT", 123, VALUE ( "123" ) ), ( "FLOAT", 123.45678, VALUE ( "123.45678" ) ), ( "Scientific (1)", 123e3, VALUE ( "123e3" ) ), ( "Scientific (2)", 123e-3, VALUE ( "123e-3" ) ), ( "Date (1)", DATE ( 2020, 10, 23 ), VALUE ( "2020-10-23" ) ), ( "Date (2)", DATE ( 2020, 10, 23 ), VALUE ( "10/23/2020" ) ), ( "Date (3)", DATE ( 2020, 10, 23 ), VALUE ( "23/10/2020" ) ), ( "Time (1)", TIME ( 10, 23, 45 ), VALUE ( "10:23:45" ) ), ( "Time (2)", TIME ( 18, 05, 00 ), VALUE ( "18:05:00" ) ), ( "Time (3)", TIME ( 18, 05, 00 ), VALUE ( "6:05:00 pm" ) ), ( "Time (4)", TIME ( 18, 05, 00 ), VALUE ( "6:05pm" ) ) }

Value1 Value2 Value3
INT 123 123
FLOAT 123.45678 123.45678
Scientific (1) 123000 123000
Scientific (2) 0.123 0.123
Date (1) 44127 44127
Date (2) 44127 44127
Date (3) 44127 44127
Time (1) 0.4331597222222222 0.4331597222222222
Time (2) 0.7534722222222222 0.7534722222222222
Time (3) 0.7534722222222222 0.7534722222222222
Time (4) 0.7534722222222222 0.7534722222222222

Power BI convert text to number

Last update: Jul 18, 2022   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://docs.microsoft.com/en-us/dax/value-function-dax

DirectQuery

  • Power BI

    v13.0.1700.1022 →
    v16.0.36.23

  • Excel

    v11.0.9165.1186 →
    v13.0.1700.1119

  • SSAS Tabular

    • SSAS 2012
    • SSAS 2014
    • SSAS 2016
    • SSAS 2017
    • SSAS 2019

  • Azure AS
  • SSDT

» Show verified builds

Before 2017-01-01

This function performs a Context Transition if called in a Row Context. Click to read more.

This expression is executed in a Row Context. Click to read more.

The use of this function is not recommended. See Remarks and Related functions for alternatives.

The use of this parameter is not recommended.

This function is deprecated. Jump to the Alternatives section to see the function to use.

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

This parameter is deprecated and its use is not recommended.

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Want to improve the content of VALUE? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.

  • Power BI convert text to number
  • Power BI convert text to number
  • Power BI convert text to number
  • Power BI convert text to number
  • Power BI convert text to number
  • Power BI convert text to number
  • Power BI convert text to number

I’m creating a calculated column in a Power BI report. The calculated column concatenates integer and text columns. I tried using the below query to accomplish this, but it resulted in a syntax error.

CalculatedColumn = Number.ToText(table1.[RegionID]) & " " & table1.[RegionName]

I tried some other conversion methods also, which were not successful. Could someone please guide me on how one could achieve the above objective in Power BI?

1

Hi,

I’m converting some imported data from xls. In xls, FieldName(“PEPM Revenue”) is formatted as a currency. But in BI, it is a text field. What syntax should I use to convert this into number format?

Thank you for your help.

Welcome to the forum! How did you bring in your data into Power BI? Power BI brought in the data that way, but you can edit it in the Query Editor. Here is an example of the different options you have( All I did was left click on the ABC in the highlighted column):

Power BI convert text to number

Thanks

Power BI convert text to number

Some other simple options as well

You can simply choose number or currency from the Modeling tab in the Data Type section to convert your data, or you can use the VALUE function.

Thanks
Sam

Number.FromText(text as nullable text, optional culture as nullable text) as nullable number

Returns a number value from the given text value, text.

  • text: The textual representation of a number value. The representation must be in a common number format, such as "15", "3,423.10", or "5.0E-10".
  • culture: An optional culture that controls how text is interpreted (for example, "en-US").

Example 1

Get the number value of "4".

Usage

Number.FromText("4")

Output

4

Example 2

Get the number value of "5.0e-10".

Usage

Number.FromText("5.0e-10")

Output

5E-10