# Best Way to Calculate Percentage Changes in Performance Metrics

**URL:** <https://community.dynatrace.com/t/best-way-to-calculate-percentage-changes-in-performance-metrics/57297>\
**Category:** Open Q&A\
**Created:** [October 28, 2026, 7:51pm UTC](https://community.dynatrace.com/t/best-way-to-calculate-percentage-changes-in-performance-metrics/57297 "2026-10-28T19:51:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Colls](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@Thomas\_Colls](https://community.dynatrace.com/u/Thomas_Colls)\
**Post date:** [October 28, 2026, 7:51pm UTC](https://community.dynatrace.com/t/best-way-to-calculate-percentage-changes-in-performance-metrics/57297/1 "2026-10-28T19:51:11Z")

</div>

Hi everyone,

I’m interested in learning how others calculate percentage changes when analyzing application performance metrics.

For example, if an application’s average response time increases from 200 ms to 250 ms, the increase is 25%. Similarly, comparing error rates or resource usage over different time periods can help identify performance issues.

I’m curious about the best way to calculate these percentages in Dynatrace dashboards. Do you generally use metric expressions, calculated metrics, or another approach to compare values over time?

I’d also like to know how you handle cases where the baseline value is zero or very small, since that can make percentage changes misleading.

For occasional manual checks, an online percentage calculator can also be helpful.

I’d appreciate any suggestions or examples from your experience. Thanks!

---

<div class="post-metadata">

**Author:** ![Fin\_Ubels](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fin_ubels/32/18008_2.png) [@Fin\_Ubels](https://community.dynatrace.com/u/Fin_Ubels)\
**Post date:** [October 29, 2026, 12:13am UTC](https://community.dynatrace.com/t/best-way-to-calculate-percentage-changes-in-performance-metrics/57297/2 "2026-10-29T00:13:38Z")

</div>

Hey Thomas,

I usually use a query very similar to the below for calculating percentage changes over time.

```auto
timeseries now = avg(dt.host.disk.used, scalar:true), by:{dt.smartscape.host}

| join [
  timeseries before = avg(dt.host.disk.used, scalar:true), by:{dt.smartscape.host}, shift:-168h
  ], on:{dt.smartscape.host}, fields:{before}

| fieldsAdd change = (now - before) / before * 100

```

This takes a timeseries and gets a single value using the scalar option. Then does a join on the exact same query but timeshifted 7 days. You can timeshift however you like for comparison, but generally I go with -7d or -28d for a fair comparison. Then on the last line there is the percentage change calculation.

In the event the timeseries does not have a clear way of joining, I normally rewrite the query like below to manually add the joining field.

```auto
timeseries now = avg(dt.host.disk.used, scalar:true)
| fieldsAdd join = true

| join [
  timeseries before = avg(dt.host.disk.used, scalar:true), shift:-168h
  | fieldsAdd join = true
  ], on:{join}, fields:{before}

| fieldsAdd change = (now - before) / before * 100

```

You can ofcourse remove the scalar option, but this means you’ll get a minute by minute graph of comparisons which is generally volatile and less valuable.

This format is also really good for manually adding trend values to single value tiles. By default the trend value calculated in a single value tile just uses the same period shifted by the value of the period. Using the above as a template allows you to calculate custom trends to make more meaningful values in dashboards.

---

<div class="post-metadata">

**Author:** ![Thomas\_Colls](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@Thomas\_Colls](https://community.dynatrace.com/u/Thomas_Colls)\
**Post date:** [October 29, 2026, 5:56pm UTC](https://community.dynatrace.com/t/best-way-to-calculate-percentage-changes-in-performance-metrics/57297/3 "2026-10-29T17:56:01Z")

</div>

Thanks for sharing these examples! The `timeseries` and `join` approach makes sense, especially when comparing current metrics with values from 7 or 28 days earlier. Using `scalar:true` is also helpful when you want a single percentage-change value instead of a volatile minute-by-minute comparison.

One thing worth considering is handling cases where the previous value (`before`) is zero, since dividing by zero can produce an invalid result. Adding a condition for that scenario can make the calculation more reliable.

For quick checks of percentage changes and other percentage calculations, I also find this percentoffcalculator useful.

Thanks again for explaining how you use custom trend values in single-value tiles!
