Add a calculation
Compare and summarize the results of an explore
A calculation adds a measure to one explore. Use it for percentages, running totals, or comparisons between results. Use a model aggregation for a definition that other explores should reuse.
Before you start
You need permission to edit the document and query its models. Open an explore with the input fields selected. Check its filters and sort order first.
Add a built-in calculation
- Select Edit on the document, then Edit tile on the explore.
- In the field list, select Add calculation.
- Choose Calculation, then the operation you need.
- Set Calculation name and select the input Column.
- Select the calculation in the field list to include it in the result.
- Check a few values against a manual calculation.
- Close the editor. In Manual save, select Save changes on the document.
The menu groups operations by purpose:
| Group | Examples |
|---|---|
| Row comparisons | Percent change from the previous row |
| Percentages | Percent of column total or maximum |
| Column summaries | Column total, running total, maximum, or rank |
| Row summaries | Row total, running total, or maximum |
For example, sort monthly revenue from oldest to newest before comparing each month with the previous row. Check that filters include the periods you want to compare.
Use a custom expression
Choose Add calculation → Calculation → Custom. Give it a name and enter its Expression. Use the editor's field suggestions to reference selected results. Check the SQL reference for expression syntax.
For a one-off summary of source rows, choose Aggregation from Add calculation instead. That summary belongs to the explore. It does not create a reusable metric in the model.
Resolve a missing input
Column missing means the calculation references a field that is no longer selected. Select that field again, or choose another input column. When a calculation changes unexpectedly, inspect its inputs, filters, and ordering before editing its formula.