Forum Discussion
first time user power query extracting text from URL into column
hello all,
new user. super limited programming knowledge. first time on forums (advice appreciated if going about it wrong)
I have a URL query in PowerBI (https://websiteurl/api/thisisthetextiwant/01/moreurltexthere) and I want to bring the specific text highlighed into a column in my query. the URL is the source for my table, it does not exist in its own table. I want to run future queries and the highlighted text is the only thing which is different and needs its own column. Im just lost on what type of query this would be. THe URL is always the same length and construction so my thought was how can I get the text "23 characters from the left" and until the "/01".
Table source: (https://websiteurl/api/thisisthetextiwant/01/moreurltexthere)
| Header 01 from URL json | Header 02 from URL json | Header 03 from URL json | Custom Column |
| data | data | data | thisisthetextiwant |
| data | data | data | thisisthetextiwant |
11 Replies
- eliasayyy
Memorable Member
hello goober04 in power query go to add columns and choose new custom column
type inlet fullURL = [url], // Get the full URL from the current row extractedText = Text.Middle(fullURL, 23, Text.PositionOf(fullURL, "/01") - 23) // Extract the desired substring in extractedText- eliasayyy
Memorable Member
try this
let fullURL = [url], // Get the full URL from the current row extractedText = Text.Middle(fullURL, 23, Text.PositionOf(fullURL, "/01") - 23) // Extract the desired substring in extractedText
- goober04New Member
Ok. we are getting somewhere but still an error.
the URL isnt in the dataset itself, its where the dataset it coming from. Am i missing something....again?