Value.Multiply

Value

Returns the product of multiplying two values, with support for numbers and durations.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Value.Multiply(value1 as any, value2 as any, optional precision as nullable number) as any

Parameters

NameTypeRequiredDescription
value1anyYesThe first value (number, duration, etc.).
value2anyYesThe second value to multiply by.
precisionnumberNoControls floating-point precision. Defaults to Precision.Double.

Return Value

anyThe product of value1 and value2.

Remarks

Value.Multiply returns the product of value1 and value2. It is the **functional equivalent of the * operator** in M — Value.Multiply(a, b) produces the same result as a * b.

This function supports type coercion across compatible types:

  • **number * number** — standard numeric multiplication, returning a number.
  • **duration * number** — scales a duration by a numeric factor, returning a duration.
  • **number * duration** — equivalent to duration * number.

The optional precision parameter controls floating-point precision for numeric operations. By default, Precision.Double is used. You can specify Precision.Decimal for higher-precision decimal arithmetic.

If the two values are of incompatible types (e.g., text * number), an error is raised.

Examples

Example 1: Calculate line totals from unit price and quantity

Table.AddColumn(
    Table.SelectColumns(Table.FirstN(Sales, 5), {"OrderID", "Product", "UnitPrice", "Quantity"}),
    "LineTotal", each Value.Multiply([UnitPrice], [Quantity]), type number
)
Output
OrderID
Product
UnitPrice
Quantity
LineTotal
11Widget A254100
22Gadget B502100
33Widget C1510150
44Gadget D75175
55Widget A25250

Example 2: Scale a duration by a factor

Value.Multiply(#duration(0, 2, 0, 0), 3)
Output
Result
10.06:00:00

Example 3: Simple multiplication of two numbers

Output
Result
156

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks