Equal to (=) DAX Operator
The “equal to” operator = returns TRUE when the two arguments have the same value.
This operator does not perform any implicit conversion between strings, numbers, and Boolean values.
The following comparisons always return TRUE:
- A comparison between BLANK and 0
- A comparison between BLANK and an empty string
- A comparison between BLANK and FALSE
This comparison differs from == only when at least one of the two terms is BLANK.
The following are valid expressions using the “equal to” operator.
Product[Color] = "Red" Product[Color] = BLANK() -- Returns TRUE if Product[Color] is either BLANK or an empty string, otherwise returns FALSE Product[Color] = "" -- Returns TRUE if Product[Color] is either BLANK or an empty string, otherwise returns FALSE Sales[Quantity] = 1 Sales[Quantity] = BLANK() -- Returns TRUE if Sales[Quantity] is either BLANK or 0, otherwise returns FALSE Sales[Quantity] = 0 -- Returns TRUE if Sales[Quantity] is either BLANK or 0, otherwise returns FALSE Customer[LargeFamily] = TRUE Customer[LargeFamily] = BLANK() -- Returns TRUE if Customer[LargeFamily] is either BLANK or FALSE, otherwise returns FALSE Customer[LargeFamily] = FALSE -- Returns TRUE if Customer[LargeFamily] is either BLANK or FALSE, otherwise returns FALSE
The following expressions return the same result using different comparison operators.
-- The following two expressions return the same result OR ( <exp> == 0, ISBLANK( <exp> ) ) <exp> = 0 -- The following two expressions return the same result OR ( <exp> == "", ISBLANK( <exp> ) ) <exp> = ""
See Handling BLANK in DAX for more details about BLANK comparisons.
Last update: Aug 9, 2022 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo, Kenneth Barber