---
title: "Create KPI based on Expressions"
description: "Combine saved expressions with mathematical formulas to calculate advanced business metrics."
lang: en
languages:
  en: https://docs.vismasoftware.no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/index.md
  no: https://docs.vismasoftware.no/no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/index.md
lastmod: 2026-07-21
---

> Documentation index: https://docs.vismasoftware.no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/llms.txt


# Create KPI based on Expressions

Last modified July 21, 2026

> Combine saved expressions with mathematical formulas to calculate advanced business metrics.

In this example, we create a KPI that shows gross margin in %. This KPI will be based on the expressions *INCOME* and *COGS*.

1. In the **Report Designer** menu, select **KPIs** and then **Manage KPIs**.

    ![](https://docs.vismasoftware.no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/test.png)

2. In the dialog that opens, click **New**.

3. In the next dialog, enter a KPI group name (in the example *Financial KPIs*). You can also add a description.

4. Click **Add** and enter a name of the KPI; *GROSS MARGIN %*. You may also enter a comment.

    ![](https://docs.vismasoftware.no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/image-2.png)

5. This KPI will be based on expressions, so make sure that the **Based on Expressions** option is selected.

    Next, you must indicate which measure the expressions that will be included in the KPI are based on.

6. Click the **Edit measure** button in the *Measure* box.

7. Find and select the measure that the expressions *INCOME* and *COGS* are based on. In our case, this is **Net Amount** (under *General Ledger Transactions)*.

8. Click **OK** to confirm.

    ![](https://docs.vismasoftware.no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/image-3.png)

9. Click the **Edit** button in the **Formula** field.

    ![](https://docs.vismasoftware.no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/image-4.png)

    The **KPI Editor** opens:

    |     | **Name**           |
    |-----|--------------------|
    | 1   | Expressions        |
    | 2   | **Formula** area   |
    | 3   | **Operators** area |

    The KPI *GROSS MARGIN %* will consist of the expression *INCOME* minus the expression *COGS* divided by *INCOME* to get the result in percent.

    The formula will look as shown in the figure below:

    ![](https://docs.vismasoftware.no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/image-6.png)

10. To build the formula, perform the following steps:

    a. In the **Operators** section, click **(** (left parenthesis) twice.

    b. Drag the expression *INCOME* into the **Formula** area*.*

    c. In the **Operators** area, click **\*** (multiply by) and type -1. This is to convert the income amounts that are negative in the ERP system into positives so that the entities that will be calculated are both positive in order to give the correct result.

    d. In the **Operators** area, click **)** (right parenthesis).

    e. In the **Operators** area, click **--** (minus).

    f. Drag the expression *COGS* into the **Formula** area*.*

    g. In the **Operators** area, click **)** (right parenthesis).

    h. In the operation section, click **/** (divide by).

    i. Drag the expression *INCOME* into the **Formula** area.

    j. In the **Operators** area, click **\*** (multiply by) and type -1. (Again to convert the income amounts into positives.)

    k. In the **Operator** section, click **)** (right parenthesis).

    l. Click **OK** to confirm.

11. Click **OK** and then **Close** to exit the **KPI** dialog.


---

[View this page](https://docs.vismasoftware.no/onestopreporting/create-templates/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/)
