---
schema_version: "1"
id: 20ff5cee2ba8a5a41358de742f46d45dffde4ba9df91af96f279ea514ce29923
title: Calculated Measurements Use Cases
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_dat_setup_meas_mgmt_use_case.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_dat_setup_meas_mgmt_use_case.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 93518e36d2b88d38d6e353a0abeb7bb319f11a7ec35e5c0a622328fa21ed90c7
description: Use these examples when creating calculated measurements to easily create fields. Each example contains an explanation with a code sample.
products:
  - Marketing
  - Marketing Cloud Intelligence
release: "264"
---
# Calculated Measurements Use Cases

Use these examples when creating calculated measurements to easily create fields. Each example contains an explanation with a code sample.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Intelligence Reports Advanced</td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_data_management_and_analytics-264-0-0-production-enus/7988f60d-cd94-4b42-8836-dc11773564b5/images/icon_note.png)

Note Calculated measurements can be used in pivot tables, reports, and dashboards, but not in queries.

Tips:

- For Equals use ‘==’
- For Or use ‘||’
- For And use ‘&&’
- For “not” use ‘!’ (expression)

**Calculate Your Own Rate**

You want to calculate the key performance indicators (KPIs) in Intelligence Reports for Engagement using a different formula. For example, the Email Open Rate is calculated by dividing the Unique Email Opens by the Email Deliveries. With calculated measurements, create another version of the Email Open Rate that uses the Email Sends as the denominator instead of the Email Deliveries.

_**Formula**_

IFERROR(someExpression, number)

_**Description**_

Returns someExpression if it’s a valid number, otherwise it returns a number.

_**Example**_

To create Email Open Rate:

```
IFERROR([Email_Unique_Opens]/[Email_Sends], 0)
```

_**Original Data Set**_

  
| Campaign | Email Send | Email Unique Opens |
| --- | --- | --- |
| Welcome | 50 | 35 |
| Birthday | 65 | 10 |
| Promotion | 70 | 55 |

_**Results with Calculated Measurement**_

 
| Campaign | Open Rate (Calculated) |
| --- | --- |
| Welcome | 70% |
| Birthday | 15% |
| Promotion | 78% |

**Calculate Filtered Metrics**

Create a measurement that’s filtered based on a condition. For example, create a dedicated measurement for clicks from each device for Mobile clicks, and Web clicks.

_**Formula**_

IF(condition,resultIfTrue,resultIfFalse)

_**Description**_

Returns the second argument, if the first argument is true, and the third argument if otherwise.

_**Formula**_

LOWER(text)

_**Description**_

Converts all uppercase letters in a text string to lowercase.

_**Examples**_

```
Desktop clicks metric: IF(Lower([Email_Device_Type])== desktop,[Email_Unique_Clicks],0)
```

```
Mobile clicks metric: IF(Lower([Email_Device_Type]) == 'mobile',[Email_Unique_Clicks],0)
```

_**Original Data Set**_

  
| Campaign | Email Device Type | Email Unique Clicks |
| --- | --- | --- |
| Welcome | Mobile | 40 |
| Welcome | Desktop | 55 |
| Birthday | Desktop | 35 |
| Birthday | Desktop | 70 |
| Birthday | Mobile | 30 |

_**Results with Calculated Measurement**_

  
| Campaign | Mobile Clicks | Desktop Clicks |
| --- | --- | --- |
| Welcome | 40 | 55 |
| Birthday | 30 | 105 |

**Calculate a Share Metric**

You want to calculate the share of unique clicks by any dimension. For example, the share of unique clicks by Email Link Alias.

_**Formula**_

SUM(metric, \[groupByDims\])

_**Description**_

Computes the sum of the given metric grouped by the supplied dimensions (optional).

_**Example**_

To calculate the share of email unique clicks

```
[Email_Unique_Clicks]/SUM([Email_Unique_Clicks])
```

You can then use this metric alongside any relevant dimension, and get the share of the metric according to that dimension.

_**Original Data Set**_

 
| Email Link Alias | Email Unique Clicks |
| --- | --- |
| Header | 30 |
| Fill in form | 50 |
| Go to site | 25 |

_**Results with Calculated Measurement**_

 
| Email Link Alias | Share of Clicks (Calculated) |
| --- | --- |
| Header | 28% |
| Fill in form | 47% |
| Go to site | 23% |
|   |   |

**Count Distinct Use Case**

You want to count the number of unique Email Content Names.

_**Formula**_

COUNTDISTINCT(\[dimensions\], \[groupByDims\])

_**Description**_

Returns the number of unique appearances of dimension value combinations, within the supplied context dimensions. If no groupBy dimensions are supplied, the row context is used by default.

_**Example**_

```
COUNTDISTINCT([Email_Content_Name])+[Email_Sends]-[Email_Sends]
```

_**Original Data Set**_

 
| Campaign | Email Content Name |
| --- | --- |
| Welcome | A\_Welcome\_AMER |
| Welcome | A\_Welcome\_EMEA |
| Birthday | A\_Birthday\_EMEA |
| Birthday | B\_Birthday\_AMER |
| Birthday | B\_Birthday\_APAC |

_**Results with Calculated Measurement**_

 
| Campaign | Unique Email Content Names (Calculated) |
| --- | --- |
| Welcome | 2 |
| Birthday | 3 |