Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
benryon1
Microsoft Employee
Microsoft Employee

If column x in table 1 starts with column y in table 2, return value in column z in table 2

I have two tables. In Table 1 is a list of URLs from a website, with page views and date. Table 2 is a category table that has the beginning of URL's that map to various categories.

 

I want to create an old fashioned vlookup with a text.beginswith to return Column Z from Table 2 as a new custom column in Table 1, utilizing Column X (full URL) and Column Y (beginning of URL). 

 

How the blue devil do I do this? Is it possible? Or is it so simple I'm missing something?

 

Table 1

DateURL (Column X)Page ViewsNew Column (Column Z)
1/1/2019www.xxxx.com/zzzz/34545451,233Category 1
1/1/2019www.xxxx.com/qq/rrr/345466663,444Category 2
1/2/2019www.aaaa.com/ooo/iii/343454551,222Category 3
1/2/2019www.xxxx.com/zzzz/ereree33,444Category 1

 

Table 2

URL (Column Y)Category (Column Z)
www.xxxx.com/zzzz/Category 1
 www.xxxx.com/qq/Category 2
www.aaaa.com/ooo/iii/Category 3
1 ACCEPTED SOLUTION
SteveCampbell
Memorable Member
Memorable Member

  1. open power query
  2. duplicate the URL URL (Column X) in Table 1
  3. On the Home table select  >  Split Column > Split by Delimiter
  4.  
  5. Annotation 2020-04-15 165638.png
  6. this wll give you a new column with the base url and some junk after it - you can delete that one
  7. Join table 2 to table 1 on the new column x and URL (Column Y


Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



View solution in original post

4 REPLIES 4
SteveCampbell
Memorable Member
Memorable Member

  1. open power query
  2. duplicate the URL URL (Column X) in Table 1
  3. On the Home table select  >  Split Column > Split by Delimiter
  4.  
  5. Annotation 2020-04-15 165638.png
  6. this wll give you a new column with the base url and some junk after it - you can delete that one
  7. Join table 2 to table 1 on the new column x and URL (Column Y


Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



I was thinking that before, but the URL structure is different for many different URLs. Instead of working from the end, I was hoping ot match certain values from the beginning. 

 

Some URLs:

Not sure if this makes sense? 

This is what produces from my answer

 

 

 

URL (Column x).1 (highlighted) would match in the original table, you can delete .2

Otherwise you could start from left and just get the base

 

If not maybe I do not understand what would be needed



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



No, actually, this works afterall. Thanks for sharing!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors