Please note javascript is required for full website functionality.

# Power Pivot Principles: The A to Z of DAX Functions – BITOR

12 April 2022

In our long-established Power Pivot Principles articles, we continue our series on the A to Z of Data Analysis eXpression (DAX) functions. This week, we look at BITOR.

The BITOR function

I’m starting to get used to these functions now, well a BIT anyway (get it?).  This function returns a bitwise ‘OR’ of two numbers.  In this variant, this means that the value of each bit position (the corresponding number reading from right to left when represented in binary) is counted if any of the parameter's bits at that position are 1.

The BITOR function employs the following syntax to operate:

BITOR(number1, number2)

The BITOR function has the following arguments:

• number1 and number2: these are required and represent scalar expressions that return numbers.  If they are not integers, they are truncated.

It should be noted that:

• the result is a bitwise 'OR' of its parameters
• in the result, each bit position is 1 if any of the parameter's bits at that position are 1
• the values returned from the bit positions progress from right to left as powers of 2.  The rightmost bit returns 1 (2^0), the bit to the left returns 2 (2^1), and so on
• this function supports both positive and negative numbers.