Date.ToRecord

Date.ToRecord is a Power Query M function that returns a record containing the parts of the given date value.

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

Syntax

Date.ToRecord( date as date ) as record

Description

Returns a record containing the parts of the given date value, date.

  • date: A date value for from which the record of its parts is to be calculated.

Examples

Convert the #date( 2011, 12, 31 ) value into a record containing parts from the date value.

Date.ToRecord( #date( 2011, 12, 31 ) )

 /* Output: 
[
      Year = 2011,
      Month = 12,
      Day = 31
]
 */ 

Other functions related to Date.ToRecord are:

BI Gorilla Youtube Channel

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