Duration.TotalDays

Duration

Returns the total number of days represented by a duration value.

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

Syntax

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

Parameters

NameTypeRequiredDescription
durationdurationYesThe duration value to convert to total days.

Return Value

numberThe total number of days as a decimal.

Remarks

Duration.TotalDays returns the total elapsed time of a duration value expressed as a decimal number of days. Unlike Duration.Days, which returns only the whole day component, Duration.TotalDays includes fractional days. If the input is null, the function returns null.

Examples

Example 1: Convert DurationMinutes to total days

Table.AddColumn(
    Table.SelectColumns(
        Table.SelectRows(
            OrderLog,
            each [DurationMinutes] <> null
        ),
        {"LogID", "DurationMinutes"}
    ),
    "TotalDays",
    each Duration.TotalDays(#duration(0, 0, [DurationMinutes], 0)),
    type number
)
Result
LogID
DurationMinutes
TotalDays
1L0021,7251.20
2L0042,7451.91
3L0061,0650.74
4L0082,6701.85

Example 2: Total days from a scalar duration

#table(
    type table [Duration = duration, TotalDays = number],
    {{#duration(2, 12, 0, 0), Duration.TotalDays(#duration(2, 12, 0, 0))}}
)
Result
Duration
TotalDays
12.12:00:002.50

Compatibility

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