Forum Discussion

RuneStrand's avatar
RuneStrand
Frequent Visitor
6 years ago
Solved

Finding if values from multiple columns in table1 exists in one column of table2

Hi    Fairly new to PowerBI, and with a relatively complicated data-set, I have been an active reader of posts in the community. I have however not been able to find a solution to a challenge:   ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hello RuneStrand 

    To do this you can use lookupvalue to return true or false for each column in the table. When any of the 4 columns return a non blank the Output will be true else it will be false.

     

    it might not be the prettiest  piece of code, but it will do the trick.

     

    Here is the code:

     

    Calculation =
    IF (
        NOT (
            ISBLANK ( LOOKUPVALUE ( Table2[ID_Code]; Table2[ID_Code]; Table1[ID_code1] ) )
        )
            || NOT (
                ISBLANK ( LOOKUPVALUE ( Table2[ID_Code]; Table2[ID_Code]; Table1[ID_code2] ) )
            )
            || NOT (
                ISBLANK ( LOOKUPVALUE ( Table2[ID_Code]; Table2[ID_Code]; Table1[ID_code3] ) )
            )
            || NOT (
                ISBLANK ( LOOKUPVALUE ( Table2[ID_Code]; Table2[ID_Code]; Table1[ID_code4] ) )
            );
        TRUE ();
        FALSE ()
    )

     

    Kind regards
    Joren Venema

    Data & Analytics Consultant
    If this reply solved your question be sure to mark this post as the solution to help others find the answer more easily.