Calculated Fields
A calculated field lets you create a new field using a formula based on existing fields - essential for custom metrics that aren't already present in the raw data.
Creating a Calculated Field
Analysis menu -> Create Calculated Field...
Name the field and write the formula, e.g.:
[Profit] / [Sales]
Common Calculation Types
- Basic arithmetic - e.g. Profit Ratio = [Profit] / [Sales].
- Logical (IF/CASE) - e.g. IF [Sales] > 1000 THEN "High" ELSE "Low" END.
- String functions - e.g. combining or extracting text with functions like
LEFT,MID, orCONTAINS. - Date functions - e.g.
DATEDIFFto calculate days between two dates.
Table Calculations vs Calculated Fields
Regular calculated fields are computed row by row on the underlying data, while table calculations (like running totals or percent of total) are computed on the aggregated results already shown in the view.
Level of Detail (LOD) Expressions
{FIXED [Region] : SUM([Sales])}
LOD expressions control exactly which level of granularity a calculation is performed at, independent of the dimensions currently in the view.
Calculated fields are reusable across every sheet in the workbook once created, so it's worth naming them clearly - a well-named calculation saves confusion later when a dashboard has dozens of fields.