Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Check if value has multiple different values in another table

I don't seem to find a good formula to solve this. I have two tables:

 

Table 1, with unique values:

Person
Pedro
Jose
Maria

 

Table 2:

Person Country
Pedro Spain
Pedro Spain
Jose Spain
Jose Portugal
Maria Spain

 

I need to add a column in table 1 which indicates if the person has been in multiple countries or only in a single one, like this:

 

Person Several Countries
Pedro NO
Jose YES
Maria NO

 

Thank you for the support!

2 Replies

  • Anonymous 

    Assuming tabe 1 is linked to table 2 by person, add this as a column in table 1.

    Several Countries = 
    VAR _Count = CALCULATE ( COUNTROWS ( DISTINCT ( 'Table 2'[Country] ) ) )
    RETURN IF ( _Count > 1, "YES", "NO" )