OpenBI Docs Buy

Duration.Days

The whole days of a duration, leaving out the hours, minutes and seconds beyond them.

Group: Dates and times. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Duration.Days(duration as nullable duration) as nullable number
ParameterTypeDescription
durationnullable durationThe duration; null gives null.

Returns

nullable number. The number of whole days.

Remarks

  • This is a part, not a total: 2 days and 19 hours give 2, where Duration.TotalDays gives about 2.79.
  • A negative duration gives negative parts.

Examples

Two days and a bit

Duration.Days(#duration(2, 5, 30, 0))
2

A delivery time

Duration.Days(#datetime(2024, 3, 18, 10, 0, 0) - #datetime(2024, 3, 15, 14, 30, 0))
2

From 15 March 14:30 to 18 March 10:00 is 2 days, 19 hours and 30 minutes.

Duration.TotalDays, Duration.Hours, #duration.

Last updated · OpenBI Studio 0.3.79