Get startedGet started for free

Define core calculations with metrics

1. Define core calculations with metrics

Welcome to chapter 2.

2. Scenario setup

In this video, we'll learn how to enhance our data model by adding reusable calculations called Metrics.

3. Scenario setup

Oakmark is pleased with the data models we've been creating. However, they are concerned by the fact that many of their analysts are getting different results in summary calculations, even when calculating them from the same data.

4. Scenario setup

They notice that users are performing certain calculations in different ways, leading to mismatched results between departments, teams, and even individual analysts.

5. What are metrics?

Metrics are the solution to this problem. Metrics allow you to define common calculations inside the data model, which are then available for use in workbooks.

6. What are metrics?

They keep calculations consistent and prevent users from making small mistakes when performing manual calculations.

7. What are metrics?

A common example of a use case for a metric is calculating revenue. Revenue needs to be calculated the same way company-wide to ensure consistent results, plans, and budgets. If departments include slightly different line items or date ranges, they'll inevitably get different results. Standardizing our revenue calculation in a metric could help avoid these issues.

8. Demo

Metrics are defined on a table element in a data model.

9. Demo

While editing a data model, Metrics for an element are listed in the **Metrics** section of the editor panel, under **Modeling**.

10. Demo

You can also view and manage metrics in the **Properties** tab, by selecting the **Metrics** tab next to **Columns.**

11. Demo

In both tabs, you can add, delete, and edit Metrics for that data element.

12. Demo

In the published version of a data model, any metrics chosen as "Highlighted metrics" display at the top of the page.

13. Demo

You can also view the metrics for any data element, by selecting View details, and opening the Metrics tab. All metrics for a data element are listed here.

14. Demo

You can click on either of these to open a detailed view of the metric. It displays a description, the formula used to create the metric, and an option to explore the metric.

15. Metrics vs calculated columns

Note that metrics are not the same as calculated columns or table summaries in the source table.

16. Metrics vs calculated columns

Metrics are always calculated across the entire element, and they update based on changes in the data source, such as when additional rows are added.

17. Metrics vs calculated columns

Metrics must use an aggregate function in their formula, and they can not use window functions.

18. Metrics vs calculated columns

While calculated columns and table summaries have their place in a data model, when it comes to providing one calculation or KPI across multiple users, a metric is the way to go.

19. Let's practice!

In the next video, we'll demonstrate how to add and use a metric. For now, test your knowledge with a few questions.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.