Please note javascript is required for full website functionality.

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

29 March 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 BITAND.

The BITAND function

Welcome to Functions You’re Unlikely to Use This Side of Doomsday, Part 97.

The BITAND function returns a bitwise ‘AND’ of two numbers.  For those of us without PhD’s in IT, this means that the value of each bit position (the corresponding number reading from right to left when represented in binary) is counted only if both parameter's bits at that position are one [1].

The BITAND function employs the following syntax to operate:

BITAND(number1, number2)

The BITAND function has the following arguments:

• number1 and number2: these are required, represent any scalar expressions that return a number.  If it is not an integer, it is truncated.

It should be further noted that:

• BITAND returns a decimal number
• the result is a bitwise 'AND' of its parameters
• the value of each bit position is counted only if both 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 its left returns 2 (2^1), and so on
• this function supports both positive and negative numbers.