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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Bublic
New Member

Add Column based on other table columns value

Hi!

Need your help with simple task..

 

I have 2 tables with no relations between them:

#Table1({"ColumnA", "ColumnB"}, {{1,Green Apple },{2,Red Potato},{3,Blue Star},{4,Kung Fu Panda}})  

#Table2({"ColumnC", "ColumnD"}, {{apple, fruit},{potato, vegetable},{star, astronomical object},{kung fu, martial art}}) 

 

The goal is to add ColumnE to Table1 with this condition:

if Text.Contains(Table1[ColumnB, Table2[ColumnC]) then Table2[ColumnD] else null 

 

The result should be:

#Table1({"ColumnA", "ColumnB","ColumnE"}, {{1,Green Apple , fruit},{2,Red Potato, vegetable},{3,Blue Star, astronomical object},{4,Kung Fu Panda, martial art}})  

 

This perfectly works with manual static if blocks, but I have no idea how to automate this task using values from table.

 

Any ideas?

 

1 ACCEPTED SOLUTION
Bublic
New Member
6 REPLIES 6
Bublic
New Member

Pragati11
Super User
Super User

Hi @Bublic ,

 

Try splitting your "Column B" on spaces. So you will send up with somwhting like this:

Column B.1 Column B.2

Green          Apple

Red             Potato.....

 

Now create relationship between both of your table using Column B.2  from 1st table and Column C from 2nd table.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Column B can contain value like : "The biggest green apple all over the world". How can I guess which splitted column to use?

Hi @Bublic ,

 

In that case, you shared the wrong sample data to your issue.

Go with the option suggested by @Greg_Deckler .

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Greg_Deckler
Community Champion
Community Champion

@Bublic 

@ImkeF @edhans 

 

In DAX, this would be LOOKUPVALUE or MAXX(FILTER(...)...)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

In my casev  LOOKUPVALUE is not working without relationship(

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.