cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Creating a column with data from URLs

I'm pulling URL data from Google Analytics to view a list of least viewed pages. Since the data is so vast, even for a 90 day timeframe, I want to create a slicer to limit the data by category. I can pick the category out of the URL, but I'm having trouble setting up a good calculation. Here's an example of the URL list.

 

website.com/category

website.com/category.html

website.com/category/sub-page.html

 

And it goes on and on like that with category text varying in length and the delimiters that surround it. Setting a start and end delimiter doesn't seem like an option because the delimiters vary and just doing a range of text doesn't work either, since the text varies in lenghth. Any suggestions or corrections on my assumptions?

1 ACCEPTED SOLUTION
Community Support
Community Support

@kurtcollins ,

 

You may use code below to add a custom column.

Text.BetweenDelimiters(Text.Replace([Column1], ".html", "/"), "/", "/")
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

@kurtcollins ,

 

You may use code below to add a custom column.

Text.BetweenDelimiters(Text.Replace([Column1], ".html", "/"), "/", "/")
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks! That worked.

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors