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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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