Duration.TotalMinutes

Duration

Returns the total duration expressed as a fractional number of minutes.

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

Syntax

Duration.TotalMinutes(duration as nullable duration) as nullable number

Parameters

NameTypeRequiredDescription
durationdurationYesA duration value.

Return Value

numberThe total number of minutes (including fractional parts) represented by the duration.

Remarks

Duration.TotalMinutes returns the entire duration as a decimal number of minutes. For example, 2 hours and 30 minutes returns 150.0. This differs from Duration.Minutes, which returns only the minutes component of the duration (e.g., 30 for the same input, not 150). Use Duration.TotalMinutes when you need elapsed time as a single numeric value for SLA analysis, billing calculations, or reporting. If the input is null, the function returns null.

A natural way to produce a duration for this function is to subtract two datetime values: Duration.TotalMinutes(endTime - startTime). The result is a decimal number, so 1 hour and 45.5 seconds returns 60.00833....

For other total-duration conversions, use Duration.TotalDays, Duration.TotalHours, or Duration.TotalSeconds. Use Duration.Minutes when you only need the minutes component (0–59) of a multi-day duration, not the cumulative total.

Examples

Example 1: Confirm total minutes match the source DurationMinutes column

Table.AddColumn(
    Table.SelectColumns(
        Table.SelectRows(OrderLog, each [DurationMinutes] <> null),
        {"LogID", "DurationMinutes"}
    ),
    "TotalMinutes",
    each Duration.TotalMinutes(#duration(0, 0, [DurationMinutes], 0)),
    type number
)
Result
LogID
DurationMinutes
TotalMinutes
1L0021,7251,725
2L0042,7452,745
3L0061,0651,065
4L0082,6702,670

Example 2: Total minutes for a mixed duration

#table(
    type table [Duration = duration, TotalMinutes = number],
    {{#duration(0, 2, 30, 0), Duration.TotalMinutes(#duration(0, 2, 30, 0))}}
)
Result
Duration
TotalMinutes
10.02:30:00150

Example 3: Compute elapsed minutes between two datetime values

let
    Created = #datetime(2024, 1, 15, 9, 30, 0),
    Shipped = #datetime(2024, 1, 16, 14, 15, 0)
in
    #table(
        type table [Created = datetime, Shipped = datetime, ElapsedMinutes = number],
        {{Created, Shipped, Duration.TotalMinutes(Shipped - Created)}}
    )
Applied Steps

The final output — a one-row table showing the Created datetime, Shipped datetime, and the elapsed time between them expressed as total minutes.

Created
Shipped
ElapsedMinutes
11/15/2024 9:30:00 AM1/16/2024 2:15:00 PM1,725

Compatibility

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