OpenBI Docs Buy

BITLSHIFT

A whole number's bits shifted left by a number of places.

Group: Math. Compatible with DAX.

Syntax

BITLSHIFT ( <Number>, <Shift_Amount> )
ParameterTypeDescription
NumberWhole numberThe number whose bits move.
Shift_AmountWhole numberHow many places they move to the left; a negative amount moves them right.

Returns

Whole number. The number with its bits moved left: each place doubles it.

Remarks

  • BITLSHIFT ( 1, 4 ) is 16, and BITLSHIFT ( 5, -1 ) moves one place right instead, giving 2.
  • Numbers are 64 bits wide; keep the amount between -63 and 63.
  • A blank number gives BLANK; a blank amount counts as 0.

Examples

Moving bits to the left

EVALUATE
ROW (
    "1 by 4", BITLSHIFT ( 1, 4 ),
    "5 by -1", BITLSHIFT ( 5, -1 ),
    "3 by blank", BITLSHIFT ( 3, BLANK () )
)
1 by 45 by -13 by blank
1623

BITRSHIFT, BITAND, BITOR, POWER.

Last updated · OpenBI Studio 0.3.74