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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
donkeyeminence
New Member

How to match inputs to a list of category Power Query

donkeyeminence_0-1676449907446.png

 

 


Column A are all the different types of inputs that could be related to a particular category.

How can I do it in such a way that my output becomes something like this?

donkeyeminence_0-1676449960121.png

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

NewStep=let a=Table.ToList(Table2,each {Text.Split(_{0},","),_{1}}) in Table.AddColumn(Table1,each Text.Combine(List.Zip(List.Select(a,(x)=>List.Contains(x{0},[Others],(x,y)=>Text.Contains(y,x)))){1},","))

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

NewStep=let a=Table.ToList(Table2,each {Text.Split(_{0},","),_{1}}) in Table.AddColumn(Table1,each Text.Combine(List.Zip(List.Select(a,(x)=>List.Contains(x{0},[Others],(x,y)=>Text.Contains(y,x)))){1},","))

oh my goodness, it works thank you so much! Could you explain how the code works? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors