Table Values
A table is a structured value composed of: 1) Rows, where each row represents a record; 2) Columns, where each column represents a field of a record and has a specific datatype; and 3) Headers, which are the names of each column.Tables can be created in many different ways in M, including using the #table constructor, or from values, lists, records, columns or rows using the appropriate M function.
Structure
table(
columns as any,
rows as any,
) as any
Examples
let
Source = #table(
type table [ProductID = text, ProductQuantity = number, Column3 = date],
{
{“P001”, 10, #date(2023, 8, 13)},
{“P002”, 25, #date(2023, 8, 14)},
{“P003”, 30, #date(2023, 8, 15)}
}
)
in
Source
There are many ways to construct tables using #table, as well as other functions that creates tables from other kinds of primitive and structured value. These methods will be addressed in...