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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Column Value in another Comma Separated Column of the same table

Hello,

 

I have setup a direct query and my table look like the below

Country Table

ID           Country Code                Countries                     Measure

X                     BE                       BE, NL, FR, LU                    TRUE

Y                     DE                       BE, NL, FR, LU                   FALSE

I want to create measure, which tells me whether the value (always one) under "Country Code" is part of the "Countries".

Any hint would be appreciated.

 

Thank you!!

 

 

2 REPLIES 2
ghoshabhijeet
Solution Supplier
Solution Supplier

Hi @Anonymous , Thanks for your query.

Here is the solution:

Check = 
VAR CountryVal = MIN( 'DataTable'[Country Code] )
VAR CheckVal = SWITCH(
    TRUE(),
    CONTAINSSTRINGEXACT(MIN('DataTable'[Countries]), CountryVal), "Yes",
    "No")
RETURN
CheckVal


ghoshabhijeet_0-1677794002263.png

 

** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search and help others. Thank you !

Good Luck 👍

 

vicky_
Super User
Super User

Measure = CONTAINSSTRING(SELECTEDVALUE([Countries]), SELECTEDVALUE([CountryCode]))

something like the above should work.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors