Custom Measures versus Custom Report Expressions

The decision to use a custom measure versus a custom report expression depends on how you want the data to be computed.

Custom Measures

A custom measure is a new measure you create from fields in the underlying database, using a special formula syntax in the Admin > Customize Space > Custom Measures tab. When you add a custom measure, Designer and Visualizer list it in their Default Subject Areas.

For example, a custom measure called Revenue Formula shows total revenue using this formula:

[Quantity]*[Unit Price]

Birst multiplies each unit price with its corresponding quantity and then sums it.

Subject Area for Custom Measures

Report Expressions

Custom report expressions are expressions that are presented to the user on-the-fly in a report. They use measures from a subject area. The aggregation is included in the definition of a measure to be used on a report.

For example:

[Sales Date: Sum: Quantity]*[Sales Date: Avg: Unit Price]

Differences Between a Custom Measure and a Report Expression

Compared to the custom measure that calculates from the database fields, the report expression gives a different result because it first computes the aggregations. For example, it computes the sum of Quantity and then multiplies that with the average Unit Price for all units.
Note: It is very important to be aware of this difference if you want accurate data.

This example divides the revenue into product categories and the result differs from the custom measure approach:

Table 1. Result Comparisons
Category Name Sales Date:Revenue Formula Sales Date:Sum:Quantity
Fruit 31,295.48 31,262.89
Meat 83,303.36 83,078.7
Nuts 45,370.75 45,329.71
Vegetable 24,427 24,537.05

For this example, the first approach would be the most correct; however, the approach you choose may vary based on what you are trying to communicate.