You are here:
Use Calculated Fields
If the underlying data doesn't include all the fields necessary for analysis, you can create fields by using calculations. These fields are called calculated fields. Calculated fields don’t physically exist in the database. They’re based around a formula and can include functions, operators, literals, or other inputs such as existing fields from your dataset.
For example, consider a calculated field Final Cost that computes an item's final cost for a customer with the formula:
[Price]*(1-[Discount])*(1+[Tax Rate])
-
The fields are in brackets: Price, Discount, and Tax Rate.
-
The operators are multiplication (*), subtraction (-), and addition (+).
-
The numeral 1 is a literal.
Calculated fields can be dimensions or measures depending on their characteristics and use. Calculated dimensions are qualitative, categorical fields. Calculated measures are quantitative, numerical fields. In both cases, the formula is the crucial part of defining a calculated field. See Formulas in Calculated Fields.
Calculated insights aren't quite the same thing. For more information, see Calculated Insights.
Calculated Dimensions
A calculated dimension is used to segment, classify, or group the data. Dimensions are typically discrete and often have a data type of text, boolean, date, datetime, URL, email, or phone number.
Use cases:
-
Consolidate dimensions: If you have dimensions containing different pieces of information that are often used together you can concatenate them. For example, if there's a dimension for first name and a dimension for last name, you can combine them into a dimension for full name:
-
[First Name] + " " + [Last Name] to combine first and last name (with a space between them)
-
[Last Name] + ", " + [First Name] to combine them as last name comma first name (with a space after the comma)
-
-
Group dimensions: If you have detailed values that you want to combine into categories, you can evaluate values and group them. For example, the following calculation takes five different types of book formats and groups them into two simple categories, paperback or hardcover:
CASE [Book Format] WHEN "Mass market paperback" THEN "Paperback" WHEN "Trade paperback" THEN "Paperback" WHEN "Paperback graphic" THEN "Paperback" WHEN "Hardcover" THEN "Hardcover" WHEN "Hardcover graphic" THEN "Hardcover" END
Calculated Measures
A calculated measure, like all measures, are aggregated. They're typically continuous and often have a data type of number, percentage, or currency. Since measures are aggregated, quantitative fields, they have additional metadata such as aggregation type, decimal place, data role, and sentiment.
Use Case:
-
Key performance indicators (KPIs): If you have various metrics native to your data source, you can use a calculated measure to compute a rate based on those fields:
SUM([Unique Email Opens]/SUM([Email Sends])to define the Email Open Rate
- Create a Calculated Field
Calculated fields are fields that don't exist in the underlying data and are defined with a formula. Calculated dimensions are qualitative, categorical fields used to group, classify, and segment data. Calculated measures are quantitative, numerical fields that are aggregated. - Configure Calculated Field Settings
Like all fields, calculated fields have a field type of dimension or measure. Depending on the field type, calculated fields have additional field settings or metadata to be configured, such as data role, aggregation type, or sentiment. - Add Filters to a Calculated Field
Filters let you choose which data can be in the formula expression. Filters help you increase the accuracy of your measures. - Filter Operators
Filter operators are used when creating filters in calculated fields. - Delete a Calculated Field
You can delete a calculated field from your semantic model.

