Duration.Days

Updated on

Duration.Days is a Power Query M function that extracts the days portion of a duration value. The function returns an integer representing the number of days.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

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

Description

Duration.Days returns the number of whole days in the specified duration duration.

Examples

Extract the number of days between two dates.

// Output: 7
Duration.Days( #date( 2022, 3, 4 ) - #date( 2022, 2, 25 ) )

Learn more about Duration.Days in the following articles:

Other functions related to Duration.Days are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/duration-days