CONVERT DAX Function (Math and Trig)
Convert an expression to the specified data type.
Syntax
| Parameter | Attributes | Description |
|---|---|---|
| Expression |
An expression which needs to be converted. |
|
| DataType |
An enumeration that includes: BOOLEAN/LOGICAL, CURRENCY/DECIMAL, DATETIME, DOUBLE, INTEGER/INT64, STRING/TEXT. |
Return values
The value of the Expression converted to the desired DataType.
Remarks
CONVERT returns an error when it cannot convert Expression to DataType. For example, CONVERT ( “abc”, INTEGER ) returns an error. CONVERT ( 1E20, INTEGER ) also returns an error, because the value is too large for an integer.
When DataType is INTEGER, CONVERT rounds the value to the nearest integer. A value that ends in .5 is rounded away from zero. For example, CONVERT ( 2.5, INTEGER ) returns 3 and CONVERT ( -2.5, INTEGER ) returns -3. INT is different, because INT rounds down: INT ( 3.7 ) returns 3, but CONVERT ( 3.7, INTEGER ) returns 4.
When DataType is CURRENCY, CONVERT rounds the value to four decimal places. For example, CONVERT ( 1.123456, CURRENCY ) returns 1.1235.
When Expression is BLANK, CONVERT returns BLANK. The only exception is BOOLEAN: CONVERT ( BLANK (), BOOLEAN ) returns FALSE.
Use CONVERT when an expression must always return the same data type. For example, a calculated column must have a single data type. If an expression can return a variant (like a string with an integer number in some rows and a decimal number in other rows), use CONVERT ( <expression>, DOUBLE ) to always return a decimal number.
Examples
-- CONVERT converts any expression in the requested datatype
-- Supported data types are:
-- INTEGER, DOUBLE, STRING, BOOLEAN, CURRENCY, DATETIME
EVALUATE
{
( "Date1", CONVERT ( "12/25/1966", DATETIME ) ),
( "Date2", CONVERT ( "12-25-1966", DATETIME ) ),
( "Date3", CONVERT ( 12345, DATETIME ) ),
( "Date4", CONVERT ( FALSE, DATETIME ) )
}
| Value1 | Value2 |
|---|---|
| Date1 | 1966-12-25 00:00:00 |
| Date2 | 1966-12-25 00:00:00 |
| Date3 | 1933-10-18 00:00:00 |
| Date4 | 1899-12-30 00:00:00 |
Related articles
Learn more about CONVERT in the following articles:
-
Differences between INT and CONVERT in DAX
This article describes the small differences between INT and CONVERT in DAX that may end up returning different results in arithmetic expressions. » Read more
-
Replacing relationships with join functions in DAX
This article describes how to join tables in DAX when there are no relationships in the data model. The data lineage plays an essential role in this scenario. » Read more
-
Rounding errors with different data types in DAX
This article describes the possible rounding differences that can appear in DAX. They are related to the data types and the operation being performed: knowing these details helps you write more robust DAX formulas and avoid errors in comparisons. » Read more
Last update: Nov 2, 2026 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://learn.microsoft.com/en-us/dax/convert-function-dax