Number Functions Overview

Updated on

Understand Number Functions in Power Query M Language, useful when performing operations on numerical data in data analytics tasks. This page provides a comprehensive list and descriptions of Number Functions available in the M Language.

Table of contents

Bitwise Operation Functions

FunctionDescription
Number.BitwiseAndReturns the result of performing a bitwise “And” operation between the two inputs.
Number.BitwiseNotReturns a byte where each bit is the opposite of the input.
Number.BitwiseOrReturns the result of performing a bitwise “Or” between the two inputs.
Number.BitwiseShiftLeftShifts the bits set to the left.
Number.BitwiseShiftRightShifts the bits set to the right.
Number.BitwiseXorReturns the result of performing a bitwise “XOR” (Exclusive-OR) between the two inputs.

Creation and Conversion Functions

FunctionDescription
Byte.FromCreates an 8-bit integer from the given value.
Currency.FromReturns a currency value from the given value.
Decimal.FromCreates a Decimal from the given value.
Double.FromCreates a Double from the given value.
Int16.FromCreates a 16-bit integer from the given value.
Int32.FromCreates a 32-bit integer from the given value.
Int64.FromCreates a 64-bit integer from the given value.
Int8.FromCreates a signed 8-bit integer from the given value.
Number.FromCreates a number from the given value.
Number.FromTextCreates numbers from common text formats (“15”, “3,423.10”, “5.0E-10”).
Number.ToTextFormats the given number as text.
Percentage.FromReturns a percentage value from the given value.
Single.FromCreates a Single from the given value.

Information Functions

FunctionDescription
Number.IsEvenIndicates if the value is even.
Number.IsNaNIndicates if the value is NaN (Not a number).
Number.IsOddIndicates if the value is odd.

Mathematical Operations

FunctionDescription
Number.AbsReturns the absolute value of the number.
Number.CombinationsReturns the number of unique combinations.
Number.ExpRaises e to the given power.
Number.FactorialReturns the factorial of the number.
Number.IntegerDivideDivides two numbers and returns the integer portion of the result.
Number.LnReturns the natural logarithm of the number.
Number.LogReturns the logarithm of the number to the specified base (default e).
Number.Log10Returns the base 10 logarithm of the number.
Number.ModInteger divides two numbers and returns the remainder.
Number.PermutationsReturns the number of permutations.
Number.PowerRaises a number to the given power.
Number.SignReturns 1 if the number is positive, -1 if it is negative, and 0 if it is zero.
Number.SqrtReturns the square root of the number.

Random Number Generation Functions

FunctionDescription
Number.RandomReturns a random number.
Number.RandomBetweenReturns a random number between two numbers.

Rounding Functions

FunctionDescription
Number.RoundReturns the rounded number
Number.RoundAwayFromZeroReturns the result of rounding positive numbers up and negative numbers down
Number.RoundDownReturns the highest previous number
Number.RoundTowardZeroReturns the result of rounding positive numbers down and negative numbers up
Number.RoundUpReturns the next highest number

Trigonometric Functions

FunctionDescription
Number.AcosReturns the arccosine of the number.
Number.AsinReturns the arcsine of the number.
Number.AtanReturns the arctangent of the number.
Number.Atan2Returns the arctangent of the division of the two numbers.
Number.CosReturns the cosine of the number.
Number.CoshReturns the hyperbolic cosine of the number.
Number.SinReturns the sine of the number.
Number.SinhReturns the hyperbolic sine of the number.
Number.TanReturns the tangent of the number.
Number.TanhReturns the hyperbolic tangent of the number.

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/number-functions

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy