title: Power BI: how to merge specific tables
body: <p>I have Table A with data of specific people doing their tasks like this:</p>
  <p><a href="https://i.stack.imgur.com/pFijB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pFijB.png" alt="enter image description here" /></a></p>
  <p>I have Table B with data of needs for specific people for different periods of time like this:</p>
  <p><a href="https://i.stack.imgur.com/UHDZ9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UHDZ9.png" alt="enter image description here" /></a></p>
  <p>I also have additional table C with period definitions:</p>
  <pre><code>Period no  |  Date from | Date to
  --------------------------------------
     1       | 27/01/2021 | 24/02/2021
     2       | 25/02/2021 | 24/03/2021
  ...
  </code></pre>
  <p>There are 2 problems here:</p>
  <ol>
  <li>Someone in Table A can have Start and End dates spanning multiple periods, like for example Human B</li>
  <li>The Start and End dates may not encompass whole Periods, they can be for example just for a couple of days. And so there's an algorithm that calculates whether this counts as a period or not:</li>
  </ol>
  <ul>
  <li>if this is less than 5 days, than it doesn't count</li>
  <li>if this is between 6 and 14 days, than it's 0.5 period</li>
  <li>if it's more than 14 days, than it's 1 period</li>
  </ul>
  <p>So now I want to merge Table A with Table B, to compare needs with what was delivered, for every period. The question is how to go with this?
  My first thought was to add columns to Table A for Period and Quantity, to be able to group &amp; merge over it - but what about when this deployment can span over multiple periods? Also how to implement this conditional logic for periods?</p>