# Metrics expression just for fun

**URL:** <https://community.dynatrace.com/t/metrics-expression-just-for-fun/45573>\
**Category:** Open Q&A\
**Tags:** dynatrace-managed\
**Created:** [May 14, 2024, 2:16pm UTC](https://community.dynatrace.com/t/metrics-expression-just-for-fun/45573 "2024-05-14T14:16:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [May 14, 2024, 2:16pm UTC](https://community.dynatrace.com/t/metrics-expression-just-for-fun/45573/1 "2024-05-14T14:16:17Z")

</div>

Hello,

If you use a metric expression to get a ratio together with a default(0) option like:

var\_total:default(0)/var\_part:default(0)

Dynatrace will, if there is no measurement, do a 0/0! this will result in a “does not exist”.

so you better use an extra default(0) to correct this?

KR Henk

---

<div class="post-metadata">

**Author:** ![JoseRomero](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/joseromero/32/19486_2.png) [@JoseRomero](https://community.dynatrace.com/u/JoseRomero)\
**Post date:** [June 4, 2024, 7:34pm UTC](https://community.dynatrace.com/t/metrics-expression-just-for-fun/45573/2 "2024-06-04T19:34:05Z")

</div>

Hi henk\_stobbe,

To avoid the 0/0 error you mentioned, you can use the **default(1)** option in the denominator instead of **default(0)**. This way, if there is no measurement, the denominator will be 1, and any number divided by 1 will be that same number, while 0 divided by 1 will be 0 and will not cause an error.

Here is how you can adjust your metric:

**var\_total:default(0)/var\_part:default(1)**

 ![JoseRomero_1-1717529567595.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/a/da6e49b589b7df4d477c359ca9081a7cfb59e3e6.png)
