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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
sparvez
Helper I
Helper I

Return matched values

Dear altruists,

 

I have a column with many values which can be increased, such as;

Column 1

Apple

Pear

Kaki

Avocado

etc...

 

These values I want to find in another column, for multiple values add a sign , such as "/". Ther power query I am looking for is Result column

Column 2--------Column Result

Apple is red--------Apple

Orange, Apple is orange--------Orange/Apple

Avocado, kaki goes bad--------Avocado/kaki

Kaki is yellow--------Kaki

 

Can any one help pls?

 

regards

1 ACCEPTED SOLUTION
Manoj_Nair
Solution Supplier
Solution Supplier

I have taken your sample set and produced the below output

Manoj_Nair_0-1670008025344.png

 

I created TBL1 which has Columns 1 and TBL2 which has the Column 2 containing text within which Column 1 is to searched.

The Custom column was created using the below Transformation step

Manoj_Nair_1-1670008025346.png

 

If the solution matches your requirement, please let me know I will upload the PBIX file

View solution in original post

4 REPLIES 4
sparvez
Helper I
Helper I

Hi Manjo,  it worked , thanks a lot. Have a good day.

Manoj_Nair
Solution Supplier
Solution Supplier

I have taken your sample set and produced the below output

Manoj_Nair_0-1670008025344.png

 

I created TBL1 which has Columns 1 and TBL2 which has the Column 2 containing text within which Column 1 is to searched.

The Custom column was created using the below Transformation step

Manoj_Nair_1-1670008025346.png

 

If the solution matches your requirement, please let me know I will upload the PBIX file

Hi Manoj,

Sorry, its not working, i add here the formula. Can u pls have a look?

 

= Table.AddColumn(#"Changed Type", "Custom", each List.Accumulate(Table.ToList(#"Tbl1","",(state,current)=>if Text.Contains([Column 2], current)
then current&"/"&state
else state

)))

@sparvez Please take look at the attached pbix file

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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