Value.Versions
The versions of a versioned table, such as a Delta table or a table of an OpenBI lake, each with its data.
Group: Values, types and errors. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Value.Versions(value as any) as table
| Parameter | Type | Description |
|---|---|---|
value | any | A table read with DeltaLake.Table, or a table of OpenBI.Lake. |
Returns
table. A row per version, oldest first, and a last row with Version null for the table as it is now: Version (text), Published, Data, Modified and Durable; a lake's table adds Author and Message.
Remarks
- Data reads the table as it was at that version; Modified is when the version was written.
- A lake's table lists only the versions that changed that table.
- Any other value is an Expression.Error: it does not support versioning.
Examples
A Delta table's versions
Two versions wrote it: three orders, then two more appended.
Table.SelectColumns(Value.Versions(DeltaLake.Table(Folder.Contents("C:\Data\orders-delta"))), {"Version", "Published", "Durable"})
| Version | Published | Durable |
|---|---|---|
| 0 | true | true |
| 1 | true | true |
| null | true | true |
The first version's rows
Table.RowCount(Value.Versions(DeltaLake.Table(Folder.Contents("C:\Data\orders-delta"))){[Version = "0"]}[Data])
3
A lake table's versions, with who wrote them
let
Orders = OpenBI.Lake("lake://folder/C:\Data\shop-lake"){[Schema = "main", Item = "orders"]}[Data]
in
Table.SelectColumns(Value.Versions(Orders), {"Version", "Author", "Message"})
| Version | Author | Message |
|---|---|---|
| 1 | Docs | Lake load "First": Orders, Shops |
| 2 | Docs | Lake load "Second": More |
| null | Docs | Lake load "Second": More |