# Calculated metrics: Examples (for data sources)

We’re improving the metric creation experience. Our recent redesign lets you preview changes while you create custom and calculated metrics. We’ve also combined raw and modelled data sources into a single object called a data feed.
If you see Data Feeds in the left navigation sidebar, go to this article to see some calculated metrics examples.
These new features are being released gradually. If you don't see them in your account yet - no worries - they’re coming soon!

There are many ways to use calculated metrics to get to the data you’re looking for. This article describes just a few of them:

Note: When you create a calculated metric you enter the name(s) of the existing (reference) metrics you want to use in the calculated metric formula. As a result, you need to add the instant or custom metric(s) you want to use before creating the calculated metric. Not sure how to create a metric? Go here to learn more.

## Adding instant metrics together to create a total

You can add instant metrics together to create a calculated metric that displays a total of the combined instant metric values.

In this example, we‘ll create a calculated metric that displays the combined total number of new follows from two different social media services - Facebook and Instagram Business.

As a first step, we added the Facebook “New Follows” instant metric and the Instagram Business “New Follows” instant metric. We named them “Facebook New Follows” and “Instagram New Follows”. When creating our calculated metric, we’ll add them together to get our total number of new follows.

### To create the calculated metric:

1. In the left navigation sidebar, click Metrics to open the Metric List page.
2. Click + Add metrics.
3. Click Calculate a new metric.
4. Enter the formula for adding your instant metrics (Facebook New Follows + Instagram New Follows) (See below.)
5. Click Next.
6. Name your calculated metric and click Save.

## Calculating a percentage of total

In this example, we’ll create a calculated metric that displays the percentage of online chats that received an offline message instead of chatting with a representative.

As a first step, we created a metric that includes a count of all our chats. We named it “Chat Metric”. When creating our calculated metric, we’ll use “Chat Metric” for both parts of the equation and filter the first instance to include a specific segment of the data (only offline messages).

### To create the calculated metric:

1. In the left navigation sidebar, click Metrics to open the Metric List page.
2. Click + Add metrics.
3. Click Calculate a new metric.
4. Enter the formula for calculating your percentage of total. (Chat Metric / Chat Metric)
5. Apply a filter to the first referenced metric in your formula to include only the Offline Messages. (See below.)
6. Click Next.
7. Set the Format to Percentage.
8. Name your calculated metric and click Save.

## Displaying positive values as negative values

Sometimes your data includes positive values that have a negative context. In such cases, you can bring clarity to your data by displaying these as negative values.

In this example, we describe how to create a metric that displays lost deals as negative values. The following metric shows both won and lost deals as positive values.

As a first step, we created a metric that includes both won and lost deals data. We named it “Sales Data”. When creating our calculated metric, we’ll use the “Sales Data” metric for both parts of the equation. We’ll apply filtering to each instance and then multiply the data by -1 to turn the lost deals data into negative values.

### To create the calculated metric:

1. In the left navigation sidebar, click Metrics to open the Metric List page.
2. Click + Add metrics.
3. Click Calculate a new metric.
4. Enter the formula for displaying lost deals as negative values. (Sales Data + Sales Data * -1).
5. Filter the first metric to include only Won deals and the second to include only Lost deals.
6. Click Next.
7. Name your calculated metric and click Save.

When you display your metric as a stacked bar chart, you can quickly compare and see your lost deals as negative values.