# Filter rows, then sum

**URL:** <https://connect.superhuman.com/t/filter-rows-then-sum/8954>\
**Category:** Ask the Community\
**Created:** [July 4, 2019, 1:31pm UTC](https://connect.superhuman.com/t/filter-rows-then-sum/8954 "2019-07-04T13:31:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Atienza](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jim_atienza/32/664_2.png) [@Jim\_Atienza](https://connect.superhuman.com/u/Jim_Atienza)\
**Post date:** [July 4, 2019, 1:31pm UTC](https://connect.superhuman.com/t/filter-rows-then-sum/8954/1 "2019-07-04T13:31:02Z")

</div>

Hello everyone. I am a rank newbie.

From a table called “Field Service Report” with a date column called Date and a duration column called Hours, I want to total Hours for the **current month** only. This is the formula I came up with:

`Sum(Filter([Field Service Report].Hours,month(last([Field Service Report].Date))=Month(today())))`

The table is currently prefiltered to show only the current month’s entries. But I want the formula to work whether the table is prefiltered or not.

However, the formula is returning the total for the entire table (including the hidden rows). (1) What am I misunderstanding or doing wrong? (2) Any suggestions?

Thanks!

---

<div class="post-metadata">

**Author:** ![Nick\_Milner](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/nick_milner/32/8249_2.png) [@Nick\_Milner](https://connect.superhuman.com/u/Nick_Milner)\
**Post date:** [July 4, 2019, 2:59pm UTC](https://connect.superhuman.com/t/filter-rows-then-sum/8954/2 "2019-07-04T14:59:24Z")

</div>

Hi Jim. Does this help?

`[Table 1].Filter(Month(Date)=Month(Today())).Hours.Sum()`

https://coda.io/embed/Wt1fBvteUH/_sudJU?viewMode=embedplay&hideSections=true

---

<div class="post-metadata">

**Author:** ![Jim\_Atienza](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jim_atienza/32/664_2.png) [@Jim\_Atienza](https://connect.superhuman.com/u/Jim_Atienza)\
**Post date:** [July 5, 2019, 7:53am UTC](https://connect.superhuman.com/t/filter-rows-then-sum/8954/3 "2019-07-05T07:53:19Z")

</div>

Worked perfectly. I see my syntax was way off the mark. Need to study formula writing. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![Bruce\_Elliot](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/bruce_elliot/32/23262_2.png) [@Bruce\_Elliot](https://connect.superhuman.com/u/Bruce_Elliot)\
**Post date:** [December 14, 2021, 6:06pm UTC](https://connect.superhuman.com/t/filter-rows-then-sum/8954/4 "2021-12-14T18:06:11Z")

</div>

I had a similar problem and your solution worked perfectly for me as well. Thanks Nick!

---

<div class="post-metadata">

**Author:** ![Nicholas\_Cates1](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/nicholas_cates1/32/34297_2.png) [@Nicholas\_Cates1](https://connect.superhuman.com/u/Nicholas_Cates1)\
**Post date:** [April 7, 2023, 6:55pm UTC](https://connect.superhuman.com/t/filter-rows-then-sum/8954/5 "2023-04-07T18:55:40Z")

</div>

Thanks, Nick! I’ll try what I mean first next time—Coda is pretty intuitve.
