       ;; Store the cumulative sum field under the key :cum_sum so we know which one to sum later
       (and cum-sum?
            has-breakout?) (-> query
-                              (dissoc :breakout)
                               (assoc :cum_sum     ag-field
-                                     :aggregation ["rows"]
-                                     :fields      (distinct (concat breakout-fields [ag-field]))))
+                                     :aggregation ["sum" ag-field]))
 
       ;; Cumulative sum without any breakout fields should just be treated the same way as "sum". Rewrite query as such
            cum-sum?       (assoc query

  "Cumulative sum the values of the aggregate `Field` in RESULTS."
  {:arglists '([query results])}
  [{cum-sum-field :cum_sum, :as query} {rows :rows, cols :cols, :as results}]
  (if-not cum-sum-field results
          (let [ ;; Determine the index of the field we need to cumulative sum
                cum-sum-field-index (->> cols
                                                (map-indexed (fn [i {field-id :id}]
                                                               (when (= field-id cum-sum-field)
                                                                 i)))
                                                (filter identity)
                                                first)
                _                   (assert (integer? cum-sum-field-index))
                ;; Now make a sequence of cumulative sum values for each row
                values              (->> rows

                ;; Update the values in each row
                rows                (map (fn [row value]
                                           (assoc (vec row) cum-sum-field-index value))
                                         rows values)]
            (assoc results :rows rows))))

;; ### ADD-ROW-COUNT-AND-STATUS

