BITOR
Bit by bit OR of two whole numbers: a bit is set where either has it.
Group: Math. Compatible with DAX.
Syntax
BITOR ( <number1>, <number2> )
| Parameter | Type | Description |
|---|---|---|
number1 | Whole number | The first whole number. |
number2 | Whole number | The second whole number. |
Returns
Whole number. A number with every bit that either number has set.
Remarks
- 12 is 1100 in binary and 10 is 1010; together they make 1110, which is 14.
- Numbers with decimals are rounded to whole numbers first, a half away from zero. Negative numbers take part in 64-bit two's complement.
- A blank counts as 0 next to a number:
BITOR ( BLANK (), 3 )is 3. When both are blank, the result is BLANK. - It switches a flag on:
BITOR ( [Flags], 4 )sets the flag worth 4 and leaves the others as they are.
Examples
All bits of both
EVALUATE
ROW (
"12 or 10", BITOR ( 12, 10 ),
"Flag 4 into 9", BITOR ( 9, 4 ),
"Blank and 3", BITOR ( BLANK (), 3 )
)
| 12 or 10 | Flag 4 into 9 | Blank and 3 |
|---|---|---|
| 14 | 13 | 3 |