Text.NewGuid
TextReturns a new randomly generated GUID as a text string.
Syntax
Text.NewGuid() as textReturn Value
text — A new GUID in standard lowercase format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Remarks
Text.NewGuid generates a new version-4 (randomly generated) GUID each time it is called, returning it as a lowercase text string in the standard xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format. It takes no parameters.
Text.NewGuid is a volatile (non-deterministic) function — its result changes on every evaluation. This has an important consequence in Power Query: because the engine may evaluate expressions multiple times during a query refresh (for example, when computing row counts, previewing data, or applying filters), each evaluation will produce a different GUID. You should not rely on Text.NewGuid to produce stable, consistent unique identifiers per row across refreshes.
If you need row-level GUIDs that persist across refreshes, generate them outside Power Query (in a database column, or as a static dataset) and load them as source data. For situations where only uniqueness within a single refresh is needed — such as generating a correlation ID for an API request — Text.NewGuid is appropriate.
To validate or normalize an existing GUID string (e.g., from an external system), use Guid.From instead.
Examples
Example 1: Generate a single GUID value
Result | |
|---|---|
| 1 | a3f8c2d1-4b7e-4f2a-9c6d-1e8b3a5f0d72 |
Example 2: Add a GUID column to a table
Table.AddColumn(
#table({"CustomerName"}, {{"Alice"}, {"Bob"}, {"Charlie"}}),
"SessionID",
each Text.NewGuid()
)CustomerName | SessionID | |
|---|---|---|
| 1 | Alice | c1a2b3d4-e5f6-7890-abcd-ef1234567890 |
| 2 | Bob | d4e5f6a7-b8c9-0123-4567-89abcdef0123 |
| 3 | Charlie | e5f6a7b8-c9d0-1234-5678-9abcdef01234 |
Example 3: Verify the output is valid GUID format
Guid.From(Text.NewGuid())Result | |
|---|---|
| 1 | f0e1d2c3-b4a5-6789-0abc-def012345678 |