ISNUMBER DAX Function (Information)
Checks whether a value is a number, and returns TRUE or FALSE.
Syntax
Parameter | Attributes | Description |
---|---|---|
Value |
The value you want to test. |
Return values
Remarks
When applied to a column reference as expression, this functions tests the data type of the column, returning TRUE whether the column is of any numeric data type (Currency, DateTime, Decimal, Integer) and FALSE for any other data type.
IMPORTANT: This function does not test whether a string can be converted to a number.
Examples
-- ISLOGICAL, ISTEXT, ISNONTEXT and ISNUMBER check their argument -- for the required data type. -- -- Different results with strings, numbers, booleans, BLANK EVALUATE VAR ValueToCheck = "SQLBI" RETURN { ( "ISLOGICAL (" & ValueToCheck & ")" , ISLOGICAL ( ValueToCheck )), ( "ISTEXT (" & ValueToCheck & ")" , ISTEXT ( ValueToCheck )), ( "ISNONTEXT (" & ValueToCheck & ")" , ISNONTEXT ( ValueToCheck )), ( "ISNUMBER (" & ValueToCheck & ")" , ISNUMBER ( ValueToCheck )) }
Value1 | Value2 |
---|---|
ISLOGICAL (SQLBI) | false |
ISTEXT (SQLBI) | true |
ISNONTEXT (SQLBI) | false |
ISNUMBER (SQLBI) | false |
-- When you pass a column as the argument, these functions -- check the metadata of the column, not the specific -- content of the column in the current row EVALUATE VAR A = DATATABLE ( "S", STRING, "I", INTEGER, { { "A", 1 }, -- "A" is a string { "B", 2 }, -- "B" is a string { "1", 1 } -- "1" is considered a string, even though it contains a number } ) VAR ValueToCheck = "SQLBI" RETURN { ( "ISTEXT(S)", COUNTROWS ( FILTER ( A, ISTEXT ( [S] ) ) ) ), ( "ISNUMBER(S)", COUNTROWS ( FILTER ( A, ISNUMBER ( [S] ) ) ) ), ( "ISTEXT(I)", COUNTROWS ( FILTER ( A, ISTEXT ( [I] ) ) ) ), ( "ISNUMBER(I)", COUNTROWS ( FILTER ( A, ISNUMBER ( [I] ) ) ) ) }
Value1 | Value2 |
---|---|
ISTEXT(S) | 3 |
ISNUMBER(S) | (Blank) |
ISTEXT(I) | (Blank) |
ISNUMBER(I) | 3 |
Related functions
Other related functions are:
Last update: May 18, 2022 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/isnumber-function-dax