I frequently refer to this table of Uri.Combine combinations, so thought it might be worthwhile to post.
Base | Path | Uri.Combine |
https://www.microsoft.com | relative/path | https://www.microsoft.com/relative/path |
https://www.microsoft.com | /absolute/path | https://www.microsoft.com/absolute/path |
https://www.www.microsoft.com/ | relative/path | https://www.www.microsoft.com/relative/path |
https://www.www.microsoft.com/ | /absolute/path | https://www.www.microsoft.com/absolute/path |
https://www.microsoft.com/originalPath | relative/path | https://www.microsoft.com/relative/path |
https://www.microsoft.com/originalPath | /absolute/path | https://www.microsoft.com/absolute/path |
https://www.microsoft.com/originalPath/ | relative/path | https://www.microsoft.com/originalPath/relative/path |
https://www.microsoft.com/originalPath/ | /absolute/path | https://www.microsoft.com/absolute/path |
https://www.microsoft.com/originalPath/plus | relative/path | https://www.microsoft.com/originalPath/relative/path |
https://www.microsoft.com/originalPath/plus | /absolute/path | https://www.microsoft.com/absolute/path |
https://www.microsoft.com/originalPath/plus/ | relative/path | https://www.microsoft.com/originalPath/plus/relative/path |
https://www.microsoft.com/originalPath/plus/ | /absolute/path | https://www.microsoft.com/absolute/path |
The M code used to generate this:
let sourceUrls = { "https://www.microsoft.com", "https://www.www.microsoft.com/", "https://www.microsoft.com/originalPath", "https://www.microsoft.com/originalPath/", "https://www.microsoft.com/originalPath/plus", "https://www.microsoft.com/originalPath/plus/" }, paths = { "relative/path", "/absolute/path" }, urlsToTable = Table.FromList(sourceUrls, Splitter.SplitByNothing()), addPaths = Table.AddColumn(urlsToTable, "relatives", each paths), expandPaths = Table.ExpandListColumn(addPaths, "relatives"), rename = Table.RenameColumns(expandPaths,{{"Column1", "Base"}, {"relatives", "Path"}}), uriCombine = Table.AddColumn(rename, "Uri.Combine", each Uri.Combine([Base], [Path]), type text) in uriCombine