Forum Discussion

JAWS's avatar
JAWS
Frequent Visitor
8 years ago
Solved

How to match multiple values from multiple look up values

Hello dear all,

 

I'm trying to find a formula which allows me to create look up between my 2 tables. Table1 contains a list of movies (single values) + for each movie the list of actors playing in it. Table2 is a list of single values of all actors contained in ListOfActors in table1.

table1                                                table2

 

My goal is to find a formula which allows me to match the values from table2 with the ListOfActors in table1. I have not been able to to achieve this with different kinds of formulas like CONTAIN, FIND, etc., since there are several actors playing in a single movie and most actors are playing in several movies.

 

And in a next step, in the reporting/dashboard view, I need to be able to slice/filter the list of movies with the single actor text values from table2.

 

I hope I explained my case in a clear matter!?

 

Thanks in advance to the community for any help! :)  ... I've been stuck here for hours and hours....

 

Cheers

 

 

 

 

  • In Power Query, split your Actors column in your Movies table by delimiter (,). Then unpivot those columns. You will end up with:

     

    Movie,Actor

    Albert,A

    Albert,B

    Albert,C

    Albert,D

    Bernard,A

    Bernard,B

    Bernard,D

    ...

     

    This will allow you to achieve what you want.

4 Replies

  • jthomson's avatar
    jthomson
    Icon for Solution Sage rankSolution Sage

    Just split your list of actors by the comma delimiter and then do a bit of unpivoting

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    In Power Query, split your Actors column in your Movies table by delimiter (,). Then unpivot those columns. You will end up with:

     

    Movie,Actor

    Albert,A

    Albert,B

    Albert,C

    Albert,D

    Bernard,A

    Bernard,B

    Bernard,D

    ...

     

    This will allow you to achieve what you want.

    • JAWS's avatar
      JAWS
      Frequent Visitor

      Thanks for the help, it worked out fine!