Records
Next on our journey through structured values in Power Query’s M language, we encounter records.
Introduction to records
A record is a named list of values. While lists are a simple, ordered collection of values, records associate a field name or key to each value. This leads to a more complex, yet organized data structure.
You can think of a record as a single row in a table, where each field in the row has a unique column name and a value. Just like lists, records can contain any type of value, be it primitive (such as text, numbers, or dates), or structured (like lists, records, or tables).
You can create a record with the record initialization
operator. This involves specifying pairs of keys and values within square brackets [], also known as record initialization. What’s important here is to remember that:
- Every record is surrounded by square brackets.
- A key (the field name) is followed by an equal sign (
=
). Records allow...