Duration Functions Overview

Updated on

Delve into Duration Functions in Power Query M Language, essential when working with duration data. This page provides a comprehensive list and descriptions of Duration Functions available in the M Language.

Component Functions

FunctionDescriptionInputOutput
Duration.DaysReturns the days portion of a duration.DurationNumber
Duration.HoursReturns the hours portion of a duration.DurationNumber
Duration.MinutesReturns the minutes portion of a duration.DurationNumber
Duration.SecondsReturns the seconds portion of a duration.DurationNumber

Creation and Conversion Functions

FunctionDescriptionInputOutput
#durationCreates a duration value from numbers representing days, hours, minutes, and (fractional) seconds. NumberDuration
Duration.FromCreates a duration from the given value.AnyDuration
Duration.FromTextReturns a duration value from textual elapsed time forms (d.h:m:s).TextDuration
Duration.ToRecordReturns a record containing the parts of the duration.DurationRecord
Duration.ToTextReturns the text of the form “d.h:m:s”.DurationText

Extraction Functions

FunctionDescriptionInputOutput
Duration.TotalDaysReturns the total days this duration spans.DurationNumber
Duration.TotalHoursReturns the total hours this duration spans.DurationNumber
Duration.TotalMinutesReturns the total minutes this duration spans.DurationNumber
Duration.TotalSecondsReturns the total seconds this duration spans.DurationNumber

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