Duration.ToRecord

Duration.ToRecord is a Power Query M function that converts a duration value to a record. The function returns a record containing the parts of the duration value.

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

Syntax

Duration.ToRecord( duration as duration ) as record

Description

Returns a record containing the parts the duration value, duration.

  • duration: A duration from which the record is created.

Examples

Convert #duration( 2, 5, 55, 20 ) into a record of its parts including days, hours, minutes and seconds if applicable.

Duration.ToRecord( #duration( 2, 5, 55, 20 ) )

 /* Output: 
[
    Days = 2,
    Hours = 5,
    Minutes = 55,
    Seconds = 20
]
 */ 

Other functions related to Duration.ToRecord are:

BI Gorilla Blog

Last update: August 28, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/duration-torecord
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.