Downloads
Power Query MDurationBeginner

Duration.Hours

Returns the hours part of a duration, from 0 to 23, not counting whole days.

Syntax
Duration.Hours(duration as nullable duration) as nullable number

Returns: The hours part as a number, or null when the input is null.

What it does

Duration.Hours returns the hours part of a duration, after whole days are taken out. A duration of two days and five and a half hours has an hours part of 5. Duration.Hours is good for showing "2 days 5 hours" on a report. For the full number of hours, use Duration.TotalHours.

Syntax and arguments

Example

An approval workflow records when each invoice was submitted and when it was approved. The team shows the elapsed time as days and hours for the approval report.

let
    Submitted = #datetime(2026, 10, 27, 9, 0, 0),
    Approved = #datetime(2026, 10, 29, 14, 30, 0),
    Elapsed = Approved - Submitted,
    Days = Duration.Days(Elapsed),
    Hours = Duration.Hours(Elapsed),
    Minutes = Duration.Minutes(Elapsed)
in
    {Days, Hours, Minutes}

The elapsed time is 2 days, 5 hours and 30 minutes. The three parts are 2, 5 and 30, which together read as "2 days 5 hours 30 minutes".

Example: a second, different use

Show the hours component of a time spent figure on a timesheet, where the total is more than a day, to read it as days and hours.

Things to watch

In business terms

Approval times, close checklist timing and service levels are reported in hours. Splitting the duration into days and hours keeps the report readable, and the total hours figure keeps the service level calculation exact.

Related functions

All Power Query M functions · View as Markdown · M basics