# How to get the absolute value of a metric in a graph?

**URL:** <https://community.dynatrace.com/t/how-to-get-the-absolute-value-of-a-metric-in-a-graph/34979>\
**Category:** Dashboarding\
**Tags:** dynatrace-managed, dashboards-classic\
**Created:** [April 28, 2022, 10:31am UTC](https://community.dynatrace.com/t/how-to-get-the-absolute-value-of-a-metric-in-a-graph/34979 "2022-04-28T10:31:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SkipGroot](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@SkipGroot](https://community.dynatrace.com/u/SkipGroot)\
**Post date:** [April 28, 2022, 10:31am UTC](https://community.dynatrace.com/t/how-to-get-the-absolute-value-of-a-metric-in-a-graph/34979/1 "2022-04-28T10:31:14Z")

</div>

We have enabled NTP monitoring on our systems which provides us with the `builtin:tech.ntp.ntp_offset` metric. This value is the time offset from the actual which can be either positive or negative.

Now the problem is that for either alerting or thresholds in graphs I can only define positive offsets. I can’t add an alert or threshold for anything below a certain value. So I’d like to transform the graph to convert any negative values into positive. The absolute value in mathematical terms.

I have tried

- Looking for an absolute function, I don’t believe there is any?
- Neither are the square root or square/exponent functions which could provide this functionality with a formula.
- Putting a - sign before the metric inverts the values. This allows me to create a normal and inverted graph which works for dashboarding and alerts. But it feels very much like a workaround since everything is duplicated.

Am I missing something here or is this functionality not available (yet)?

(Using Dynatrace Managed version 1.238 if that is relevant)

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [April 28, 2022, 11:13am UTC](https://community.dynatrace.com/t/how-to-get-the-absolute-value-of-a-metric-in-a-graph/34979/2 "2022-04-28T11:13:40Z")

</div>

Hi&nbsp;[@SkipGroot](https://community.dynatrace.com/user/50400)

Can the follow threshold setting help you?

 ![Yosi_Neuman_1-1651144421430.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/8/58c88eb0aa608f3e036c9e5fdd784ffbacd2d4df.png)

And for alerting you will need to add 2&nbsp; rules one for positive (above) and the other for negative (below)

 ![Yosi_Neuman_4-1651144793036.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/1/f1472f25ec21c022ce590cc05f896398eef224a4.png)

 ![Yosi_Neuman_3-1651144730072.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/c/dc8ce7eba422e891ab000f36e47aff146b04ae8b.png)

HTH

Yos

---

<div class="post-metadata">

**Author:** ![SkipGroot](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@SkipGroot](https://community.dynatrace.com/u/SkipGroot)\
**Post date:** [April 28, 2022, 11:25am UTC](https://community.dynatrace.com/t/how-to-get-the-absolute-value-of-a-metric-in-a-graph/34979/3 "2022-04-28T11:25:42Z")

</div>

I did not realize the threshold definition colors were applied in the specified order, a weird way of doing it but it works perfectly!

And for the alerts I guess I’ll just have to duplicate the metric there. Thanks for the help!
