Duration.TotalDays
A duration's whole length counted in days, fractions included.
Group: Dates and times. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Duration.TotalDays(duration as nullable duration) as nullable number
| Parameter | Type | Description |
|---|---|---|
duration | nullable duration | The duration; null gives null. |
Returns
nullable number. The length in days, with a fraction for the hours, minutes and seconds.
Remarks
- Use it to compare or average lengths of time as numbers. Round it when a whole number is wanted.
Examples
Thirty-six hours
Duration.TotalDays(#duration(0, 36, 0, 0))
1.5
A delivery time
Duration.TotalDays(#datetime(2024, 3, 18, 10, 0, 0) - #datetime(2024, 3, 15, 14, 30, 0))
2.8125
From 15 March 14:30 to 18 March 10:00 is 2 days, 19 hours and 30 minutes.