title: Only showing one line
body: <p>Here is my code it is supposed to calculate for each line in my code but it is only producing one line for <code>MU_w_o_No_Work</code>.</p>
  
  <pre><code>var query2 = from rg in db.MU_Reports.GroupBy(r =&gt; new { r.Date, r.Shift, r.Machine_Number })
               join dt in db.Downtime_Reports
               on new { rg.Key.Date, rg.Key.Shift, rg.Key.Machine_Number }
               equals new { dt.Date, dt.Shift, dt.Machine_Number }
               into dtGroup
               select new
               {
                   rg.Key.Date,
                   rg.Key.Shift,
                   rg.Key.Machine_Number,
                   MU = rg.Sum(r =&gt; r.MU),
                   NWTotal = dtGroup.Where(dt =&gt; dt.Downtime_Code == "9185").Sum(dt =&gt; dt.Total_DownTime)
               };
  
  query2.ToList();
  
  foreach (var item2 in query2)
  {
      var y = new MU_By_Machine();
  
      y.Date = item2.Date;
      y.Shift = item2.Shift;
      y.Machine_Number = item2.Machine_Number;
      y.MU = item2.MU;
      y.MU_w_o_No_Work = (item2.MU * 8) / (8 - item2.NWTotal);
  
      db.MU_By_Machines.Add(y);
  }
  
  db.SaveChanges();
  </code></pre>
  
  <p>So I don't know what exactly I am doing wrong but here is a sample output:</p>
  
  <p>Sample Input Data</p>
  
  <pre><code>Date      | Machine Num. | Shift | MU | DT Hours
  7/11/2016 |     1        |   1   | 70 |  2
  7/11/2016 |     2        |   2   | 80 |  1
  7/11/2016 |     1        |   2   | 60 |  4
  7/12/2016 |     2        |   2   | 75 |  1
  7/12/2016 |     1        |   2   | 75 |  0
  </code></pre>
  
  <p>Sample Output Data</p>
  
  <pre><code>Date      | Machine Num. | Shift | MU | MU w/o No work
  7/11/2016 |     1        |   1   | 70 |  93.33 
  7/11/2016 |     2        |   2   | 80 |  91.43
  7/11/2016 |     1        |   2   | 60 |  120
  7/12/2016 |     2        |   2   | 75 |  85.7
  7/12/2016 |     1        |   2   | 75 |  75
  </code></pre>