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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
smoka3
Frequent Visitor

Lookupvalue using Search\ContainsString?

Hi Experts, could you please help in finding the solution for my requirement

 

I have 2 tables with 40K rows in each table,

I have slicer with package column from Table A and i have a table visual from Table B,

no relationship between Table A and Table B due to no common key value, but TableA[package] is a substring of TableB[Command]

 

my requirement is, when i filter TableA[package] using slicer, the related data should filter in tableB.

 

how can i solve this?

I tried Calculated table using CONTAINSSTRING Function

I tried Search function and LOOKUPVALUE function 

nothing worked out for me.

 

here is data looks like

Table A:

Package
 getHelp
 getSales

 migarteData

 

Table B: (may contain duplicates in command column)

ServiceCommand
 Service1 C:\file\source\getHelp\folder\aaa
 Service2 \\filegroup\folder\getSales\
 Service3 service.ex migrateddata from 2
 Service4 D:\file\source\getHelp\folder\aaa

 

Expected Output

ServiceCommandPackage
 Service1 C:\file\source\getHelp\folder\aaagetHelp
 Service2 \\filegroup\folder\getSales\getSales
 Service3 service.ex migratedata from 2migratedata
 Service4 D:\file\source\getHelp\folder\aaagetHelp

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@smoka3 , Create a new column in TableB

 

maxx(filter(TableA, CONTAINSSTRING(TableB[Command], TableA[Package])),TableA[Package])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@smoka3 , Create a new column in TableB

 

maxx(filter(TableA, CONTAINSSTRING(TableB[Command], TableA[Package])),TableA[Package])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I've just used this for a similar solution, and it's worked perfect! Thank you!

Thanks You! 

Greg_Deckler
Community Champion
Community Champion

@smoka3 - So basically this is a Complex Selector - https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534.

Kind of.

In your case, something like this:

 

Measure =
  VAR __Command = MAX('Table B'[Command])
  VAR __Table = ADDCOLUMNS(ALL('Table A'),"Include",FIND([Package],__Command,,0))
RETURN
  MAXX(FILTER(__Table,[Include]>0),[Package])

 

 

Package... LOL...



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...

Thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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