Calculated Measures, Restricted Measures, and Currency Conversion in SAC Models
Learn how to extend an SAC model's analytical power using calculated measures, restricted measures, and currency conversion so business users get correct, reusable metrics without duplicating logic in every story.
Explanation
Once a base SAC model exists with dimensions and account/measure structures, most real projects immediately need derived metrics that are not present in the source data: margin percentages, variance to plan, restricted sums filtered by a dimension member, or values converted to a reporting currency. SAC models let you define these at the model level so every story, widget, and planning form built on that model reuses the same logic instead of consultants recreating formulas in each story, which is a common source of inconsistent numbers across dashboards. Calculated measures are formulas built from existing measures (or account members in an account-based model) using arithmetic operators, aggregation functions, and conditional logic. They execute at query time against the model's data source, meaning for live models the calculation may be pushed down to the source system or evaluated in SAC depending on the connection type, while for imported (acquired) models the calculation runs against the in-memory SAC dataset. This distinction matters for performance: a calculated measure with heavy conditional logic on a large imported model can slow story rendering, whereas the same logic on a live HANA connection may be optimized by the source engine. Restricted measures apply a filter to a base measure so it only aggregates over specific dimension members, for example 'Sales - Region = APAC' as a standalone reusable metric. This differs from simply filtering a chart because the restricted measure remains a fixed, named metric that can be compared side-by-side with unrestricted totals in the same table or chart, which is essential for variance and mix analysis. Currency conversion in SAC models is configured through a currency conversion setting tied to a rate type and a target currency, using either an internal SAC currency conversion table (built from a currency conversion model you create and populate) or rates coming from the connected source system when using certain live connections. You must decide whether conversion happens at the model level (available to all stories) or is deferred to individual story-level settings; model-level conversion promotes consistency but reduces per-story flexibility, so many projects define a default corporate rate type in the model and allow analysts to override rate type only in specific approved stories. For planning-enabled models, calculated and restricted measures interact with versions: a calculated variance measure typically references both an Actual version and a Plan/Forecast version of the same account, so the model must have version dimension members correctly maintained before the calculation will return meaningful results. A common implementation sequence is: confirm base measures and account structure are stable, load or verify currency conversion source data, build restricted measures needed for entity or region-specific KPIs, then layer calculated measures (ratios, variances) on top of the base and restricted measures, and finally validate results against a known reconciled report before publishing the model to story authors. Troubleshooting typically involves unexpected null or zero results, which are usually caused by mismatched dimension granularity between the measures used in a calculation, missing currency conversion rate entries for a given period or currency pair, or a restricted measure filter referencing a dimension member that does not exist in the current data slice. Verification should include testing the calculated measure in a simple table against a small, known dataset before exposing it broadly.
Code example
-- Not ABAP/SQL executable code; SAC model calculation logic described in pseudo-formula form as configured in the Model 'Create Calculated Measure' dialog -- 1) Restricted Measure: Sales_APAC-- Base measure: Sales-- Filter: Region = "APAC"-- Result: Sales_APAC returns Sales values only where Region dimension member = APAC, and blank/zero elsewhere -- 2) Calculated Measure: Gross_Margin_Pct-- Formula: ( [Sales] - [COGS] ) / [Sales] * 100-- Notes: Divide-by-zero guarded using an IF condition in the formula editor:-- IF([Sales] = 0, null, ([Sales]-[COGS])/[Sales]*100) -- 3) Calculated Measure comparing versions (planning model): Variance_to_Plan-- Formula: [Sales].[Version = "Actual"] - [Sales].[Version = "Plan"]-- Requires the Version dimension to have both "Actual" and "Plan" members correctly loaded -- 4) Currency conversion configuration (model settings, not code):-- Target Currency: USD (Reporting Currency)-- Rate Type: Corporate_Avg-- Source: Currency Conversion model 'FX_Rates_Monthly' with columns Date, From_Currency, To_Currency, Rate, RateTypeReal project scenario
A retail client's finance team needed a single SAC model to support both regional profitability dashboards and a monthly plan-vs-actual review. The consulting team built restricted measures for each major region, added a Gross_Margin_Pct calculated measure with a divide-by-zero guard after the first UAT cycle surfaced blank tiles, and configured model-level currency conversion to USD using a monthly average rate type sourced from a currency conversion model populated via a scheduled data import. During UAT, finance flagged that margin percentages differed between the SAC story and their existing Excel report; investigation showed the Excel report used spot rates while the SAC model used average rates, which was resolved by aligning on rate type with the client and documenting the decision rather than changing the model ad hoc.
Common mistakes
⢠Building a calculated measure without a null/zero guard, causing broken tiles or errors when a denominator is zero. ⢠Defining restricted measures with filters on dimension members that get renamed or deleted later, silently breaking the metric. ⢠Applying currency conversion at the story level inconsistently across different stories sharing the same model, producing mismatched totals in shared reviews. ⢠Forgetting that live models may push calculation logic to the source system, causing different rounding or performance behavior than acquired models. ⢠Not validating variance/version-based calculated measures against a reconciled reference report before releasing to business users. ⢠Overloading a single calculated measure with excessive nested conditional logic instead of breaking it into simpler named measures, hurting maintainability and performance.
Best practices
⢠Always add null/zero guards in calculated measures involving division. ⢠Standardize currency conversion at the model level unless there is a clear, documented business need for story-level overrides. ⢠Name calculated and restricted measures clearly and consistently so story authors understand their scope without opening the formula. ⢠Validate every new calculated measure against a small known dataset before publishing broadly. ⢠Document rate type and conversion source decisions so finance and IT agree on the definition of 'reporting currency' values. ⢠Keep calculation logic layered and modular rather than building one deeply nested formula for multiple KPIs.
Interview angle
Interviewers commonly probe whether a candidate understands the practical difference between restricted and calculated measures, when currency conversion should be set at model versus story level, and how version dimensions affect planning calculations; strong answers reference real troubleshooting of null results and reconciliation against source reports rather than only definitions.