Uri.Parts
URIParses an absolute URI into a record of its component parts.
Syntax
Uri.Parts(absoluteUri as text) as recordParameters
| Name | Type | Required | Description |
|---|---|---|---|
absoluteUri | text | Yes | The absolute URI to parse. |
Return Value
record — A record containing the URI components: Scheme, Host, Port, Path, Query, Fragment, and more.
Remarks
Uri.Parts breaks an absolute URI into its components and returns them as a record with the following fields:
| Field | Type | Description |
|---|---|---|
Scheme | text | The protocol (e.g., "https"). |
Host | text | The hostname (e.g., "www.example.com"). |
Port | number | The port number (e.g., 443). |
Path | text | The path segment (e.g., "/api/data"). |
Query | record | Query string parameters as a record (e.g., [page = "1"]). |
Fragment | text | The fragment identifier after #. |
This function is useful for extracting specific parts of URLs stored in your data — for example, pulling the domain from a list of web addresses, or extracting query-string parameters.
Examples
Example 1: Parse a URL into components
Applied Steps
The final output — a table showing four selected URI components (Scheme, Host, Port, Path) extracted from the parsed record.
Component | Value | |
|---|---|---|
| 1 | Scheme | https |
| 2 | Host | api.example.com |
| 3 | Port | 8080 |
| 4 | Path | /data/items |
Example 2: Extract domain from URLs in a table
let
Source = #table({"Page"}, {{"https://shop.example.com/products/123"}, {"https://blog.example.com/posts/hello"}}),
Added = Table.AddColumn(Source, "Domain", each Uri.Parts([Page])[Host], type text)
in
AddedApplied Steps
The final output — the table with the original Page URLs and their extracted Domain host names.
Page | Domain | |
|---|---|---|
| 1 | https://shop.example.com/products/123 | shop.example.com |
| 2 | https://blog.example.com/posts/hello | blog.example.com |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks