# Help, help with calculated fields for date comparison

**URL:** <https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077>\
**Category:** Q&A\
**Tags:** analysis, level-aware, pivot-table, date, filters, calculations, visuals, Business-Intelligence-Engineer, dataset, formatting, quick-sight\
**Created:** [June 7, 2025, 10:56am UTC](https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077 "2025-06-07T10:56:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![July](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@July](https://community.amazonquick.com/u/July)\
**Post date:** [June 7, 2025, 10:56am UTC](https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077/1 "2025-06-07T10:56:20Z")

</div>

Hi guys,

I must created some calculated fields to compare datas. Could you help me, please?  
I thank you so much.

**Create calculated fields in Quick Sight to compute:**

The “current date” is not the system _current date_, but rather the _maximum date present in the dataset_.

1. **“Day”** – The financial value for the current day.

2. **“Day minus 7”** – The financial value from 7 days prior to the current date.

3. **“Week over Week”** – The percentage difference in financial value comparing the current week to the previous week.  
_Example_: if today is a Wednesday, you should compare the financial value of this week up to Wednesday with the financial value of the previous week up to Wednesday.

4. **“Current Month”** – The financial value for the current month up to the present date.

5. **“Month over Month”** – The percentage difference in financial value between the current month and the previous month.  
_Example_: if today is the 10th of the month, compare the financial value of the current month up to the 10th with the financial value of the previous month up to the 10th.

6. **“Current Year”** – The financial value for the current year up to the present date.

7. **“Year over Year”** – The percentage difference in financial value comparing the current year to the previous year.  
_Example_: if today is May 10th, 2025, compare the financial value of this year up to May 10th, 2025 with the financial value of the previous year up to May 10th, 2024.

* * *

**Important Note:**  
The “current date” is not the system _current date_, but rather the _maximum date present in the dataset_.  
For all calculated fields, you must include a check to ensure that the “current date” corresponds to the maximum date in the dataset.

* * *

**Fields:**

- **Date:** Maximum date in the dataset (considered as the “current date”)
- **Value:** Financial value

---

<div class="post-metadata">

**Author:** ![prantika\_sinha](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/prantika_sinha/32/21878_2.png) [@prantika\_sinha](https://community.amazonquick.com/u/prantika_sinha)\
**Post date:** [June 7, 2025, 7:07pm UTC](https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077/2 "2025-06-07T19:07:11Z")

</div>

Hi @July ,

You can refer to the [user guide documentation](https://docs.aws.amazon.com/quicksight/latest/user/functions-by-category.html#date-functions) available for date functions to use what fits the requirement. For e.g. for period over period difference you can use [periodOverPeriodDifference - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/user/periodOverPeriodDifference-function.html).

I would suggest to get started on exploring the functions and we can provide further support if you get stuck with errors.

You can also leverage the build Calculation function powered by Q to create your calculated fields!

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/4/d/4d7bf228257811651c3e329ba3385aa0962233dc.png)

Thanks,  
Prantika

---

<div class="post-metadata">

**Author:** ![July](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@July](https://community.amazonquick.com/u/July)\
**Post date:** [June 8, 2025, 4:00pm UTC](https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077/3 "2025-06-08T16:00:40Z")

</div>

The examples in the documentation are sometimes very simple. The difficulty is creating the partial comparison.

---

<div class="post-metadata">

**Author:** ![andrepgn](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/andrepgn/32/25909_2.png) [@andrepgn](https://community.amazonquick.com/u/andrepgn)\
**Post date:** [June 9, 2025, 2:20pm UTC](https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077/4 "2025-06-09T14:20:47Z")

</div>

Hi @July, have you tried creating a field to obtain the max date in the dataset in this way: `maxOver({Date}, [], PRE_AGG)`

Where **Date** is the field indicating the date in your rows.  
Then you add calculated fields for other fields based on this value.

Let me know if this helps.

Andrea

---

<div class="post-metadata">

**Author:** ![andrepgn](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/andrepgn/32/25909_2.png) [@andrepgn](https://community.amazonquick.com/u/andrepgn)\
**Post date:** [June 20, 2025, 1:21pm UTC](https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077/5 "2025-06-20T13:21:53Z")

</div>

Closed on June 20, 2025, 1:21pm UTC



---

<div class="post-metadata">

**Author:** ![andrepgn](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/andrepgn/32/25909_2.png) [@andrepgn](https://community.amazonquick.com/u/andrepgn)\
**Post date:** [June 20, 2025, 1:22pm UTC](https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077/6 "2025-06-20T13:22:09Z")

</div>

Opened on June 20, 2025, 1:22pm UTC



---

<div class="post-metadata">

**Author:** ![andrepgn](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/andrepgn/32/25909_2.png) [@andrepgn](https://community.amazonquick.com/u/andrepgn)\
**Post date:** [July 23, 2025, 2:41pm UTC](https://community.amazonquick.com/t/help-help-with-calculated-fields-for-date-comparison/47077/7 "2025-07-23T14:41:01Z")

</div>

Closed on July 23, 2025, 2:41pm UTC


