# Calculating Period-over-Period Changes

### **Use Case**

Calculating period-over-period changes is essential for tracking trends and growth in key business metrics such as clicks, orders, and revenue. This guide explains how to compute period-over-period comparisons, such as week-over-week or month-over-month changes, using Reorc's semantic capabilities.

### Example: Month-over-Month Change Calculation

To calculate a period-over-period metric in Reorc, follow these steps:

**Step 1: Create the Base Measure**

* Add a new measure, `no_of_member`, and define the formula. For example, use `COUNT(DISTINCT member_id)` to count distinct members.

<figure><img src="/files/IctGlL0FwM1wvACQ7JwP" alt="" width="375"><figcaption></figcaption></figure>

**Step 2: Create the Compared Measure**

* Add another measure, for example, `no_of_member_lm` having the same formula with base measure
* Enable the **Reporting Period** feature and set the time range to **Last Month**.

<figure><img src="/files/diX5V18IcHZUAWqmw4Gp" alt="" width="375"><figcaption></figcaption></figure>

**Step 3: Calculate the Period-over-Period Change**

* Create a new measure that calculates the change between the current month and the last month.

<figure><img src="/files/6l0qK2ZCEkXnxFIWy8Bs" alt="" width="375"><figcaption></figcaption></figure>

### **Conclusion**

Reorc's rolling\_window feature allows for flexible and efficient calculation of period-over-period changes. By defining reporting period and calculated measures, users can easily track performance over time and derive meaningful insights from their data.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.reorc.com/semantic-modeling/cube/custom-measure/calculating-period-over-period-changes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
