title: How to create a calculation that includes only a subset of the data?
body: <p>I have table A which describes the number of employees which passed a certain course within a certain branch. The table looks like this:</p>
  
  <blockquote>
    <p><code>--------+---------------+---------+--------------------+--------------------+
    | Branch | Course_number | Segment | Workers_for_branch | Workers_for_course |
    +--------+---------------+---------+--------------------+--------------------+
    | A      |             1 | x       |                  4 |                  1 |
    | A      |             1 | y       |                  6 |                  3 |
    | A      |             2 | x       |                  4 |                  2 |
    | A      |             2 | y       |                  6 |                  1 |
    | B      |             1 | x       |                  7 |                  1 |
    | B      |             1 | y       |                  5 |                  1 |
    | B      |             2 | x       |                  7 |                  2 |
    | B      |             2 | y       |                  5 |                  3 |
    +--------+---------------+---------+--------------------+--------------------+</code></p>
  </blockquote>
  
  <h2>Fields interpretation:</h2>
  
  <ul>
  <li>Branch - A or B</li>
  <li>Course_number - 1 or 2 (both courses are taught in each branch)</li>
  <li>Segment - X or Y (both segments are included in each course, hence in
  each branch).</li>
  <li>Workers for branch - How many workers within a segment for each
  branch. i.e. Branch A has a total of 10 workers. 4 of them belong to
  Segment X and 6 belong to Segment Y.</li>
  <li>Workers for course - captures the workers that completed the relevant
  course. i.e, the first row in the table captures 1 employee of branch
  A, segment x which passed course number 1.</li>
  </ul>
  
  <p>My goal is to represent the ratio of workers which passed the course out of the potential in each branch.  My thinking of the following calculation:
  (workers_for_course) / total workers for branch.</p>
  
  <p>Please note that the denominator must not be filltered according to course_number and Segment, but only by Branch. </p>
  
  <p>i.e. 
  I'd like to represent potential of workers who passed the course in branch A, course 1, segment x:<br>
  1/(4+6) = 1/10.</p>
  
  <p>on the contrary, the potential of workers who passed the course in branch A, course 1, segment y: 
  3/(4+6) = 3/10. </p>