title: Power Query (PowerBI) Resolving a many to many relationship
body: <p>I have two contacts tables from two sources which I need to relate:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">ID</th>
  <th style="text-align: center;">email</th>
  <th style="text-align: center;">Last Name</th>
  <th style="text-align: center;">Given Name</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">0</td>
  <td style="text-align: center;">angry@mad.com</td>
  <td style="text-align: center;">Thompson</td>
  <td style="text-align: center;">Susan</td>
  </tr>
  <tr>
  <td style="text-align: center;">1</td>
  <td style="text-align: center;">angry@mad.com</td>
  <td style="text-align: center;">Thompson</td>
  <td style="text-align: center;">Suzanne</td>
  </tr>
  <tr>
  <td style="text-align: center;">2</td>
  <td style="text-align: center;">glad@mad.com</td>
  <td style="text-align: center;">McNeil</td>
  <td style="text-align: center;">George</td>
  </tr>
  <tr>
  <td style="text-align: center;">3</td>
  <td style="text-align: center;">happy@sad.com</td>
  <td style="text-align: center;">Thompson</td>
  <td style="text-align: center;">Suzannne</td>
  </tr>
  </tbody>
  </table>
  </div><div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">Code</th>
  <th style="text-align: center;">Last Name</th>
  <th style="text-align: center;">Given Name</th>
  <th style="text-align: center;">Date Started</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">65432</td>
  <td style="text-align: center;">Thompson</td>
  <td style="text-align: center;">Susan</td>
  <td style="text-align: center;">2020/01/01</td>
  </tr>
  <tr>
  <td style="text-align: center;">65432</td>
  <td style="text-align: center;">Thompson</td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;">2019/01/01</td>
  </tr>
  <tr>
  <td style="text-align: center;">65432</td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;">Susan</td>
  <td style="text-align: center;">2018/01/01</td>
  </tr>
  <tr>
  <td style="text-align: center;">65432</td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;">2017/01/01</td>
  </tr>
  <tr>
  <td style="text-align: center;">65432</td>
  <td style="text-align: center;">Thompson</td>
  <td style="text-align: center;">Suzanne</td>
  <td style="text-align: center;">2016/01/01</td>
  </tr>
  <tr>
  <td style="text-align: center;">45678</td>
  <td style="text-align: center;">McNeil</td>
  <td style="text-align: center;">George</td>
  <td style="text-align: center;">2020/06/20</td>
  </tr>
  <tr>
  <td style="text-align: center;">45678</td>
  <td style="text-align: center;">McNeil</td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;">2019/06/20</td>
  </tr>
  <tr>
  <td style="text-align: center;">45678</td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;">George</td>
  <td style="text-align: center;">2018/06/20</td>
  </tr>
  <tr>
  <td style="text-align: center;">45678</td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;"></td>
  <td style="text-align: center;">2017/06/20</td>
  </tr>
  <tr>
  <td style="text-align: center;">25581</td>
  <td style="text-align: center;">Thompson</td>
  <td style="text-align: center;">Suzanne</td>
  <td style="text-align: center;">2020/01/01</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I need a way to link the ID from Table 1 to the Code in Table 2. However, the only common thread between the two tables is the employee's name, which is a many to many relationship and I have no way of knowing which employee is which.</p>
  <p>Both tables are prone to human error where multiple name spellings or omissions occur for the same person. However, it is possible to identify that in table 1, the email address is unique to each person (ID 0 and 1 are the same person because they use the same email address) while in table 2, the code is unique to each person (all entries with code 65432 is the same person, etc)</p>
  <p>But I am at a complete and total loss on how to create the unique keys I need for each table to link them together.</p>
  <p>I was thinking that for table 1, a unique key can be made consisting of the name + email address but I'm stuck there.</p>
  <p>Any ideas?</p>