OpenBI Docs Buy

Number.BitwiseShiftRight

Moves a whole number's bits to the right: each step halves it, dropping what falls off.

Group: Number. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Number.BitwiseShiftRight(number1 as nullable number, number2 as nullable number) as nullable number
ParameterTypeDescription
number1nullable numberThe whole number to shift.
number2nullable numberHow many bits to move it.

Returns

nullable number. The number divided by 2 to the power of the shift, the fraction dropped; null when either is null.

Examples

256 shifted four places

Number.BitwiseShiftRight(256, 4)
16

Bits that fall off are lost

Number.BitwiseShiftRight(13, 2)
3

Number.BitwiseShiftLeft, Number.BitwiseAnd, Number.IntegerDivide.

Last updated · OpenBI Studio 0.3.79