06.02 Conditional Calculations

06.02 Conditional Calculations

Overview

Conditional calculations allow you to refine or replace the default behaviour of a calculation based on specific criteria; they build on simple calculations by adding one or more override expressions that apply only when certain dimensional conditions are met.

Put another way:

You define a default expression, and then define exceptions that run instead when specific dimension values match.

This makes conditional calculations invaluable for handling real‑world reporting logic such as sign flips, alternate formulas, exceptions, data clean‑ups, and more.

Here is a video, or read below.

A Simple Example: Flipping Revenue Signs

Consider a P&L report where you want all values to appear as positive numbers, regardless of debit/credit behaviour in the ERP.

You could create a new calculation called Display Amount:

c9df7044-3c91-47e9-8ed7-0a25ec2ba22c

Default Expression

Displays the standard ERP Actuals value:

[Measures].[Balance]

Conditional Override

For a specific range of account codes (e.g., 4000–4999 for sales revenue), we override the default and instead multiply the value by –1:

[Measures].[Balance] * -1
54c57327-05b7-4940-8911-f8a6203f5bcf

In the calculation editor, conditional calculations are marked with a special symbol

ef08dfd6-cec2-485f-8df0-fa0a94ea6c20
b7750ae6-6a02-46f2-8379-a186993dab2c

to indicate that override rules are present.

What This Produces

The result is a P&L where:

A clean, readable report — without changing the underlying data.

cd076e7c-8f5b-439d-a987-0f60ed63ce6b

Using Conditionals to Restrict Where an Expression Runs

A very common use case is when a calculation should only apply in a small subset of cells, a specific zone of the grid.

The pattern is always the same:

  1. Leave the default expression blank, and

  2. Put your desired logic (expression) into an override rule (set of conditions).

This creates targeted, precisely controlled calculations without affecting the rest of the dataset.

Examples:

Using the previous example then, lets say then that we want to only show credits and not debits. To do this we remove the default expression altogether in effect causing only the inverted credits to come through as below:

4fc93943-db9a-4a0d-9334-701211d98cd4

So only the override expression runs, and only for the dimension members specified, in this case we only wanted to show the sales (credits), inverted to positive:

Common Real‑World Uses

Conditional calculations are frequently used for business accounting scenarios, such as:

Conditional calculations allow you to implement all of these without restructuring your dataset.

Exercises and Tutorial Survey

Now try the downloadable exercises below:

06 Advanced Calculations - Conditional Calculations - Exercises.pdf

Your feedback helps us do better, to fill in a short survey on this tutorial, click here.

Powered By