Text.NewGuid
A new random identifier (a GUID) as text, different on each call.
Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Text.NewGuid() as text
It takes no parameters.
Returns
text. 36 characters: 32 hexadecimal digits in groups of 8, 4, 4, 4 and 12, with dashes between.
Remarks
- The answer changes each time the query runs: a key made this way is not the same after a refresh.
- It is a random (version 4) GUID: the 13th digit is always 4. The letters are small (a to f).
Compared with Power Query
Known difference in OpenBI Studio 0.3.79, found while this page was written and run on its engine:
List.Count(List.Distinct(Table.AddColumn(#table({"Order"}, {{1}, {2}, {3}}), "Id", each Text.NewGuid())[Id])): Power Query gives 1: in a column added withTable.AddColumn, every row gets the same GUID, and the model loads it so. OpenBI gives each row its own: 3.
Examples
An identifier for a new row
Text.NewGuid()
"7f2e9559-18c2-425e-8b64-4a1fbbe9988b"
Yours will differ.