ISLOGICAL DAX Function (Information)

Checks whether a value is a logical value (TRUE or FALSE), and returns TRUE or FALSE.

Syntax

ISLOGICAL ( <Value> )
Parameter Attributes Description
Value

The value you want to test.

Return values

Scalar A single boolean value.

TRUE if the value is a logical value; FALSE if any value other than TRUE or FALSE.

Remarks

When applied to a column reference as expression, this functions tests the data type of the column and not whether it is possible to execute a type conversion to a Boolean.

» 3 related functions

Examples

--  ISLOGICAL, ISTEXT, ISNONTEXT and ISNUMBER check their argument 
--  for the required data type.
--
--  Different results with strings, numbers, Booleans, and BLANK
EVALUATE
VAR _Logical = TRUE
VAR Number  = -1.2
VAR Txt     = "SQLBI"
VAR ValueTable =
    {
        ( "ISLOGICAL(Value)", ISLOGICAL ( _Logical ), ISLOGICAL ( Number ), ISLOGICAL ( Txt ), ISLOGICAL ( BLANK () ) ),
        ( "ISNUMBER (Value)", ISNUMBER ( _Logical ), ISNUMBER ( Number ), ISNUMBER ( Txt ), ISNUMBER ( BLANK () ) ),
        ( "ISTEXT(Value)", ISTEXT ( _Logical ), ISTEXT ( Number ), ISTEXT ( Txt ), ISTEXT ( BLANK () ) ),
        ( "ISNONTEXT(Value)", ISNONTEXT ( _Logical ), ISNONTEXT ( Number ), ISNONTEXT ( Txt ), ISNONTEXT ( BLANK () ) )
    }
RETURN 
    SELECTCOLUMNS(
        ValueTable,
        "Function Call      VALUE = ",[Value1],
        "TRUE",       [Value2],
        "-1.2",       [Value3],
        """SQLBI""",  [Value4],
        "BLANK()",    [Value5]
    )
Function Call      VALUE = TRUE -1.2 “SQLBI” BLANK()
ISLOGICAL(Value) true false false false
ISNUMBER (Value) false true false false
ISTEXT(Value) false false true false
ISNONTEXT(Value) true true false true
--  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

Related functions

Other related functions are:

Last update: Mar 13, 2024   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Kenneth Barber

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

2018-2024 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

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

Row Context

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

Iterator

Not recommended

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

Not recommended

The use of this parameter is not recommended.

Deprecated

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

Volatile

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

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

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

Contribute

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


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.