Search notes:

Power Query M formula language standard library: Table.TranformColumnTypes

let
    Source = #table(
    {   "A",               "B" ,    "C",               "D"},
     {
      {  1 , #date(2021,12,15) , 43210 , #date(2020, 4,21)},
      {  2 , #date(2019, 8,28) , 40100 , #date(2018, 5, 2)}
     }
    ),
    typedSource = Table.TransformColumnTypes(Source,
      {
        {"A", Int64.Type },
        {"B", type date  },
        {"C", type date  }
      })
in
    typedSource
Github repository about-Power-Query-Formula-M, path: /standard-library/Table/TransformColumnTypes/intro.M
The following picture shows the result if the formula above is executed in Excel, for example with the VBA formula evaluator.
Note that the column D, whose values were initialized with the #date keyword, is not automatically rendered a in a date-format in Excel (as is the column B). Rather, the Table.TransformColumnTypes is necessary for that.

See also

Reading the data of an Excel Range with Power Query
The Power Query standard library

Index