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

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

Creation and Conversion Functions

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

Information Functions

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

Mathematical Operations

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

Random Number Generation Functions

FunctionDescriptionInputOutput
Number.RandomReturns a random number.NumberNumber
Number.RandomBetweenReturns a random number between two numbers.NumberNumber

Rounding Functions

FunctionDescriptionInputOutput
Number.RoundReturns the rounded numberNumberNumber
Number.RoundAwayFromZeroReturns the result of rounding positive numbers up and negative numbers downNumberNumber
Number.RoundDownReturns the highest previous numberNumberNumber
Number.RoundTowardZeroReturns the result of rounding positive numbers down and negative numbers upNumberNumber
Number.RoundUpReturns the next highest numberNumberNumber

Trigonometric Functions

FunctionDescriptionInputOutput
Number.AcosReturns the arccosine of the number.NumberNumber
Number.AsinReturns the arcsine of the number.NumberNumber
Number.AtanReturns the arctangent of the number.NumberNumber
Number.Atan2Returns the arctangent of the division of the two numbers.NumberNumber
Number.CosReturns the cosine of the number.NumberNumber
Number.CoshReturns the hyperbolic cosine of the number.NumberNumber
Number.SinReturns the sine of the number.NumberNumber
Number.SinhReturns the hyperbolic sine of the number.NumberNumber
Number.TanReturns the tangent of the number.NumberNumber
Number.TanhReturns the hyperbolic tangent of the number.NumberNumber
BI Gorilla Youtube Channel

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