Forum Discussion

WBADAM03's avatar
WBADAM03
Frequent Visitor
3 years ago
Solved

Conditional column based on if a record exists in another table

Hey all, I hope this is the right place to ask this question: I have table1 that has a list of students. I have table2 that has a table with student records. I want to have a column in ta...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi WBADAM03 ,

     

    I created some dummy data for reference.

    Table (1) has the student's names, Table (2) has the students' grades, and if the student in Table (1) has no grades in Table (2), then NA is returned.

    Then you can create the following column to solve it.

    Column = 
    IF(
        'Table (1)'[Student] in SELECTCOLUMNS('Table (2)',"Student",[Student]),"Y","NA")

     

                                                                                                                                                             

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.