Duration.Hours
The hours part of a duration, 0 to 23, beyond its whole days.
Group: Dates and times. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Duration.Hours(duration as nullable duration) as nullable number
| Parameter | Type | Description |
|---|---|---|
duration | nullable duration | The duration; null gives null. |
Returns
nullable number. The hours left over after the whole days.
Remarks
- This is a part, not a total: 2 days and 5 hours give 5.
Duration.TotalHourscounts them all. - A negative duration gives negative parts.
Examples
The hours of a duration
Duration.Hours(#duration(2, 5, 30, 0))
5
A delivery time
Duration.Hours(#datetime(2024, 3, 18, 10, 0, 0) - #datetime(2024, 3, 15, 14, 30, 0))
19
From 15 March 14:30 to 18 March 10:00 is 2 days, 19 hours and 30 minutes.