Strictly equal to (==) DAX Operator


The “strictly equal to” operator == returns TRUE when the two arguments have the same value or are both BLANK.
A comparison between BLANK and any other value returns FALSE.
This operator does not perform any implicit conversion between strings, numbers, and Boolean values.
This comparison differs from = only when at least one of the two terms is BLANK, empty string, or 0.

The following are valid expressions using the “strictly equal to” operator.

Product[Color] == "Red"
Product[Color] == BLANK()        -- Returns TRUE if Product[Color] is BLANK, returns FALSE if it is "" or any other value
Product[Color] == ""             -- Returns TRUE if Product[Color] is an empty string, returns FALSE if it is BLANK or any other value
Sales[Quantity] == 1
Sales[Quantity] == BLANK()       -- Returns TRUE if Sales[Quantity] is BLANK, returns FALSE if it is 0 or any other value
Sales[Quantity] == 0             -- Returns TRUE if Sales[Quantity] is 0, returns FALSE if it is BLANK or any other value
Customer[LargeFamily] == TRUE    -- Returns TRUE if Customer[LargeFamily] is TRUE, returns FALSE if it is FALSE or BLANK
Customer[LargeFamily] == BLANK() -- Returns TRUE if Customer[LargeFamily] is BLANK, otherwise returns FALSE
Customer[LargeFamily] == FALSE   -- Returns TRUE if Customer[LargeFamily] is FALSE, returns FALSE if it is TRUE or BLANK
Sales[Order Date] == BLANK()     -- Returns TRUE if Sales[Order Date] is BLANK, returns FALSE for any other value
Sales[Order Date] == 0           -- Returns TRUE if Sales[Order Date] is 1899-12-30, returns FALSE if it is BLANK or any other value
Date[IsHoliday] == BLANK()       -- Returns TRUE if Date[IsHoliday] is BLANK, returns FALSE if Date[IsHoliday] is either TRUE or FALSE
Date[IsHoliday] == TRUE          -- Returns the same value as Date[IsHoliday] (TRUE if Date[IsHoliday] is TRUE, BLANK if it is BLANK, FALSE if it is FALSE)
Date[IsHoliday] == FALSE         -- Returns TRUE if Date[IsHoliday] is FALSE, returns FALSE if Date[IsHoliday] is either TRUE or BLANK

The following expressions return the same result using different comparison operators.

-- The following two expressions return the same result
AND ( <exp> = 0, NOT ISBLANK( <exp> ) )
<exp> == 0

-- The following two expressions return the same result
AND ( <exp> = "", NOT ISBLANK( <exp> ) )
<exp> == ""

There is no “strictly not equal to” operator (such as <> vs. ==), which can be obtained by using the NOT of the “strictly equal operator”:

<exp> == <value>               -- <exp> strictly equal to <value>
NOT ( <exp> == <value> )       -- <exp> strictly not equal to <value>

Despite the name of the operator, when it is used on text, the operator is usually case-insensitive, according to the collation used by the engine. The collation is always case-insensitive in Power BI and Azure Analysis Services. The collation can be modified during the installation of SQL Server Analysis Services and is case insensitive by default. The EXACT function can be used for a case-sensitive comparison of text values.

Compatibility: the “strictly equal to” operator == is available in Power BI, Azure Analysis Services, and Analysis Services 2019. It is not available in earlier versions of Analysis Services and in Power Pivot for Excel.

See Handling BLANK in DAX for more details about BLANK comparisons.

Last update: Feb 24, 2024   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Kenneth Barber, Renato Lira

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 Strictly equal to (==)? 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.