Forum Discussion

letsdothis's avatar
letsdothis
New Member
8 years ago
Solved

Match ID from another table

Hi,

 

I have two tables, that are connected with an ID coloumn.

In the master table, I want a measure (or coloumn) that contains the information if the ID can be found in the other table.

 

So in table "Master" I have the following:

ID      Name

1        John

2        Peter

3        Alex

4        George

 

And in table "Activity" I have the following:

ID

1

3

 

So in table "Master" I want a measure or additional coloum that contains Yes/No based on if the ID has been found in table "Activity".

 

I hope it makes sense.

 

Thanks in advance.

  • letsdothis

     

    I believe master table is the one side

    You can use this column in master table

     

    Calculated Column =
    IF ( ISBLANK ( COUNTROWS ( RELATEDTABLE ( Activity ) ) ), "Not Found", "Found" )
  • Hi letsdothis

     

    You may try to use below measure.


    Measure =
    IF ( MAX ( Master[ID] ) IN VALUES ( Activity[ID] ), "Yes", "No" )

     

    Regards,

    Cherie

3 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    letsdothis

     

    I believe master table is the one side

    You can use this column in master table

     

    Calculated Column =
    IF ( ISBLANK ( COUNTROWS ( RELATEDTABLE ( Activity ) ) ), "Not Found", "Found" )
  • Hi,

     

    First Create a new column :

    Output = SUMX(RELATEDTABLE(Activity), Activity[Id1])  This will create a field in master table picking values from Activity table.

     

    Then Create another column :

    Flag = if( [Output]=Master[Id],1,0) 

  • v-cherch-msft's avatar
    v-cherch-msft
    Microsoft Employee

    Hi letsdothis

     

    You may try to use below measure.


    Measure =
    IF ( MAX ( Master[ID] ) IN VALUES ( Activity[ID] ), "Yes", "No" )

     

    Regards,

    Cherie