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
01_RAF_01
Frequent Visitor

How to find same value in different tables (with no relationship)

Hi Guys, 

 

trying to find a solution for finding a value in 2 different tables. 

Table 1 has values (could be multiple devided by a ",")
Table 2 has values 

1.PNG

Whats the best way to check if the exact values from the second table are also available in the first table? 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @01_RAF_01 

Please try formula as below:

Measure1 = 
CONTAINSSTRING (
    CONCATENATEX ( VALUES ( Table1 ), Table1[Value], "," ),
    MAX ( Table2[Value] )
)

veasonfmsft_0-1653472425351.png

Please check my sample file for more details.

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @01_RAF_01 

Please try formula as below:

Measure1 = 
CONTAINSSTRING (
    CONCATENATEX ( VALUES ( Table1 ), Table1[Value], "," ),
    MAX ( Table2[Value] )
)

veasonfmsft_0-1653472425351.png

Please check my sample file for more details.

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

tackytechtom
Super User
Super User

Hi @01_RAF_01 ,

 

Spontaneously, I'd suggest the CONTAINS function in DAX.

 

Here the MS documentation.

 

And here a post with an example.

 

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

daXtreme
Solution Sage
Solution Sage

Well, first you should get rid of the commas in Power Query and split the values so that in the underlying table exists a column with just the atomic values. Once you have it, it'll be soooooo much easier to match one value against the other. Bear in mind that you don't have to get rid of the original column from the underlying table. You can still keep it.

 

However, right now it's a bit obscure what you're after. Is it a measure of some kind? Is it a calculated column? I don't know.

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