title: Conditional Merge in Power Query
body: <p>I have 2 data sources FirstAPI and SecondAPI:</p>
  <p><strong>FirstAPI</strong></p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>appId</th>
  <th>policyTypeName</th>
  <th>policyTypeId</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>abcd</td>
  <td>Global</td>
  <td>null</td>
  </tr>
  <tr>
  <td>pqrs</td>
  <td>null</td>
  <td>1</td>
  </tr>
  <tr>
  <td>pqws</td>
  <td>Global</td>
  <td>null</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p><strong>SecondAPI</strong></p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>policyTypeName</th>
  <th>policyTypeId</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Americas</td>
  <td>1</td>
  </tr>
  <tr>
  <td>Global</td>
  <td>2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The values are all one-to-one mapping.</p>
  <p><strong>RESULT</strong> : I am trying to add a column to FirstAPI so that it can look like the following:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>appId</th>
  <th>policyTypeName</th>
  <th>policyTypeId</th>
  <th>newCol</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>abcd</td>
  <td>Global</td>
  <td>null</td>
  <td>Global</td>
  </tr>
  <tr>
  <td>pqrs</td>
  <td>null</td>
  <td>1</td>
  <td>Americas</td>
  </tr>
  <tr>
  <td>pqws</td>
  <td>Global</td>
  <td>null</td>
  <td>Global</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I am trying to write a query in the advanced editor so that I can add <code>newCol</code> in FirstAPI. My attempt is to use something similar:</p>
  <pre><code>if [policyTypeName] = null 
  then SecondAPI[policyTypeName] where SecondAPI[policyTypeId]=[policyTypeId]
  else [policyTypeName]
  
  </code></pre>