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
Returns the days portion of duration
.
Examples
Extract the number of days between two dates.
// Output: 7
Duration.Days( #date( 2022, 3, 4 ) - #date( 2022, 2, 25 ) )
Related articles
Learn more about Duration.Days in the following articles:
- Create ISO Week and ISO Year in Power Query M (ISO 8601)
Learn how to create ISO Week and Year numbers in Power Query for consistent weeks and fiscal calendars. Step-by-step tutorial included! » Read more - Create Date Table or Calendar in Power Query M
Learn how to create a dynamic calendar table in Power Query’s M language. Build your custom columns and claim your free Date Table Script. » Read more
Related functions
Other functions related to Duration.Days are:
