# KPI metric values

**URL:** <https://community.amazonquick.com/t/kpi-metric-values/8926>\
**Category:** Q&A\
**Tags:** calculations, formatting, quick-sight\
**Created:** [January 9, 2023, 7:37pm UTC](https://community.amazonquick.com/t/kpi-metric-values/8926 "2023-01-09T19:37:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aakashsp](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@aakashsp](https://community.amazonquick.com/u/aakashsp)\
**Post date:** [January 9, 2023, 7:37pm UTC](https://community.amazonquick.com/t/kpi-metric-values/8926/1 "2023-01-09T19:37:19Z")

</div>

Hello Team,

I have monthly metric data from Jan’21 to Dec’22 as attached below and I am trying to calculate the YoY% for the ‘current\_mau’ and ‘first\_usage’ field values using the formula **periodOverPeriodPercentDifference(sum({monthly\_first\_usage}) , FormattedDate , YEAR , 1)**

Upon setting up the calculate field, it is giving me blank values as shown. Can anyone suggest what is wrong or an alternate approach in computing this?

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/5/5aed06195602b16c53d4e1f698f69987496bf970.jpeg)

---

<div class="post-metadata">

**Author:** ![drpeter](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/drpeter/32/2772_2.png) [@drpeter](https://community.amazonquick.com/u/drpeter)\
**Post date:** [January 10, 2023, 12:31am UTC](https://community.amazonquick.com/t/kpi-metric-values/8926/2 "2023-01-10T00:31:58Z")

</div>

Hi Aakashsp,

Please see if the following solution from Jesse on a similar post can be adapted for your use case:

Last 12 months: `ifelse(dateDiff({order_date},now(),"MM") <= 12, sales, 0)`  
Last 13-24 months: `ifelse(dateDiff({order_date},now(),"MM") <= 24 AND dateDiff({order_date},now(),"MM") >12, sales, 0)`  
YoY %: `sum(Last 12 Months) / sum(Last 13-24 months) - 1`

**Similar post:** [How to calculate YOY % through certain date?](https://community.amazonquick.com/t/how-to-calculate-yoy-through-certain-date/3733)  
**Learning Center:** [Period Over Period and Other Date Comparison Calculations (YoY, MoM, YTD, Rolling 90 days, etc)](https://community.amazonquick.com/t/period-over-period-and-other-date-comparison-calculations-yoy-mom-ytd-rolling-90-days-etc/564)

If the above does not work, please send me an email with your sample data and calculation in MS Excel. Include a sheet with your calculated fields/formulas in QS.

Sincerely,

Alex  
[drpeter@amazon.com](mailto:drpeter@amazon.com)

---

<div class="post-metadata">

**Author:** ![aakashsp](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@aakashsp](https://community.amazonquick.com/u/aakashsp)\
**Post date:** [January 10, 2023, 1:57am UTC](https://community.amazonquick.com/t/kpi-metric-values/8926/3 "2023-01-10T01:57:00Z")

</div>

Thank you for the suggestion! I tried using the formula **Monthly YoY % Diff:**

**`(sum({This Month}) - sum({This Month Last Year})) / sum({This Month Last Year})** and also the way you suggested but it still gave me a blank value. I might be missing something but I’ll email you my sample data and the calculations I used. Thanks again!

---

<div class="post-metadata">

**Author:** ![drpeter](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/drpeter/32/2772_2.png) [@drpeter](https://community.amazonquick.com/u/drpeter)\
**Post date:** [January 11, 2023, 7:20am UTC](https://community.amazonquick.com/t/kpi-metric-values/8926/4 "2023-01-11T07:20:06Z")

</div>

Hi Aakash,

Try the below approaches –

> [@Creating period comparisons with QuickSight's periodOver and periodTo functions](https://community.amazonquick.com/t/creating-period-comparisons-with-quicksights-periodover-and-periodto-functions/6830):
>
> This article uses the SaaS-Sales Dataset that you can download as part of the [QuickSight Author Workshop](https://catalog.workshops.aws/quicksight/author-workshop). We will update the data to the current date so your calculations are realistic. If you do not have a QuickSight account please follow the instructions in the Initial Setup. Instructions to create the dataset can be found in Exercise 1 of the Build your first dashboard. Create an analysis for the dataset. The following steps show you how to create visuals to show data from the current year,…

[https://repost.aws/questions/QUUcFFmUcDR3WPYjBfFXtQqA/yo-y-and-mo-m-metrics-up-to-certain-day-of-year-or-month-in-quick-sight](https://repost.aws/questions/QUUcFFmUcDR3WPYjBfFXtQqA/yo-y-and-mo-m-metrics-up-to-certain-day-of-year-or-month-in-quick-sight)

Sincerely,

Alex
