# Filter a calculated property based on date field

**URL:** <https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766>\
**Category:** CRM\
**Tags:** professional\
**Created:** [March 22, 2023, 5:40pm UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766 "2023-03-22T17:40:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![miavelasco](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miavelasco/32/195227_2.png) [@miavelasco](https://community.hubspot.com/u/miavelasco)\
**Post date:** [March 22, 2023, 5:40pm UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/1 "2023-03-22T17:40:51Z")

</div>

I’d like to create a custom calculated property that sums the total revenue fiscal year to date. However, it doesn’t seem possible to filter the calculation by date.

How can I achieve this in HubSpot?

---

<div class="post-metadata">

**Author:** ![EmmaAtKiwi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/emmaatkiwi/32/78422_2.png) [@EmmaAtKiwi](https://community.hubspot.com/u/EmmaAtKiwi)\
**Post date:** [March 22, 2023, 6:48pm UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/2 "2023-03-22T18:48:48Z")

</div>

Hi @miavelasco! To create a property that calculates the sum of the total revenue to date:

1. create a new Company property (to see total revenue by company)
2. under field type, select Calculation
3. click Build Calculation
4. under Calculated Property Type, select Sum
5. under Choose the Associted Record Type, select Deal
6. under Choose the Associated Record Property, select Amount
7. click Create

You can now include your Total Revenue field in reports, lists, and/or company filters to see companies that have spent over a certain amount, best performing industries, etc.

 ![Screen Shot 2023-03-22 at 2.48.04 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/b/b11f5672b016b44c681b4b781e2da82a7da6514f.png)

---

<div class="post-metadata">

**Author:** ![miavelasco](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miavelasco/32/195227_2.png) [@miavelasco](https://community.hubspot.com/u/miavelasco)\
**Post date:** [March 22, 2023, 7:34pm UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/3 "2023-03-22T19:34:07Z")

</div>

thanks @EmmaAtKiwi . specifically what I’m looking for is the ability to add a condition to the calculated property for deals received within the fiscal year. It doesn’t appear possible to add a date field.

 ![Screenshot 2023-03-22 at 1.33.35 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/c/c4962479207950b44a4f4f0090416ca7ac4db76b.png)

---

<div class="post-metadata">

**Author:** ![EmmaAtKiwi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/emmaatkiwi/32/78422_2.png) [@EmmaAtKiwi](https://community.hubspot.com/u/EmmaAtKiwi)\
**Post date:** [March 23, 2023, 1:26pm UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/4 "2023-03-23T13:26:29Z")

</div>

Hmmm, perhaps a custom report that displays the Total Revenue by the Deal Close Date, and you can include a filter where the Close Date is less than 360 days ago, for example.

---

<div class="post-metadata">

**Author:** ![JDrejer](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@JDrejer](https://community.hubspot.com/u/JDrejer)\
**Post date:** [October 22, 2023, 11:06pm UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/5 "2023-10-22T23:06:53Z")

</div>

Hi @emma  
Sorry to inturupt! 🙂 - I think also what the author meant (and what I can see benefit in too) is on company level (in relation to deals associated) see how much revenue was generated in a fiscal year, and not just across time (like the default Total Revenue) - hence why we want to sort/filter on data range.

---

<div class="post-metadata">

**Author:** ![CSaute](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/csaute/32/41931_2.png) [@CSaute](https://community.hubspot.com/u/CSaute)\
**Post date:** [November 20, 2023, 11:22am UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/6 "2023-11-20T11:22:35Z")

</div>

Hi there,  
I have a solution for this issue.

First, I created a deal property called “Deal Year”, ~~which I calculate by workflow. If you have Operations Hub Pro or Enterprise, use data formatting to do this. If you don’t have Operations Hub, then a workflow based on closing date with branches will do.~~  
EDIT : you can use calculated property to do so as well : define it as a “number” type and use the custom equation with the function “year(close date)”. It will do the job, even without Operation Hub !

Next, I created a calculated contact property, of type sum. I selected the deal object, then the property Amount to be summed, and in the filtering conditions, I took my “Deal Year” property == 2023.

It’s obviously imperfect because you have to create a calculated property for each year, or remember to change this value every year, but it works until Hubspot allows date-based filtering.

Hope it helps !

---

<div class="post-metadata">

**Author:** ![HelloAaron](https://avatars.discourse-cdn.com/v4/letter/h/6de8d8/32.png) [@HelloAaron](https://community.hubspot.com/u/HelloAaron)\
**Post date:** [November 30, 2023, 9:42pm UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/7 "2023-11-30T21:42:09Z")

</div>

The Deal Year property doesn’t show up as a filter option when I’m creating the calculated property. Any idea why?

---

<div class="post-metadata">

**Author:** ![HelloAaron](https://avatars.discourse-cdn.com/v4/letter/h/6de8d8/32.png) [@HelloAaron](https://community.hubspot.com/u/HelloAaron)\
**Post date:** [November 30, 2023, 10:56pm UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/8 "2023-11-30T22:56:51Z")

</div>

I figured out what was wrong: the Deal Year property needs to be setup as a Number.

---

<div class="post-metadata">

**Author:** ![IZabarsky](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@IZabarsky](https://community.hubspot.com/u/IZabarsky)\
**Post date:** [February 4, 2024, 9:50am UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/9 "2024-02-04T09:50:15Z")

</div>

Hi @CSaute  
Can you share how you built the “workflow based on closing date with branches will do”  
to achieve only the year of close date field into the “Year date” property?  
Thanks!

---

<div class="post-metadata">

**Author:** ![CSaute](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/csaute/32/41931_2.png) [@CSaute](https://community.hubspot.com/u/CSaute)\
**Post date:** [February 5, 2024, 8:03am UTC](https://community.hubspot.com/t/filter-a-calculated-property-based-on-date-field/77766/10 "2024-02-05T08:03:39Z")

</div>

~~You just have to use a “if/then” branch (with filters conditions), and your triggers will be like “If close date is between 01/01/2024 and 31/12/2024” then “Deal year”=2024, etc.~~

EDIT : I just realised you can use calculated property to do so as well : define it as a “number” type and use the custom equation with the function “year(close date)”. It will do the job, even without Operation Hub !
