Dynamic format and precedence
Keep numeric value and display separate
Dynamic format expressions choose a presentation pattern while preserving the underlying measure value. A field parameter changes which field a visual uses; it is not a reusable filter-context transformation. Apply this lesson in the isolated lab after creating the time items.
Define item format expressions
For Current and Prior year use SELECTEDMEASUREFORMATSTRING() as the item format expression. For Growth use IF(ISSELECTEDMEASURE([Revenue], [Units]), "0.0%;-0.0%;0.0%", SELECTEDMEASUREFORMATSTRING()). Set Revenue model format $#,##0 and Units #,##0. Set visual display units to None; the actual text depends on locale. Do not use FORMAT to produce a string inside a numeric KPI. Field parameters can select Revenue or Units; test both against the same calculation items.
Example 1 — same transformation, different formats
At 2025 total, Revenue Current displays $260; Prior year displays $200; Growth displays 30.0%. Units displays 26, 20, and 30.0%. Growth remains numeric 0.3. Category C growth is blank, not 0%. Compare a sort on numeric growth versus a text-formatted percent column; only the numeric version retains numeric behavior.
Example 2 — noncommuting calculation items
Use a separate disposable model or copy without the time group. Define [Probe] = 8. Group AddThree precedence 10 item SELECTEDMEASURE() + 3; group Double precedence 20 item SELECTEDMEASURE() * 2. Assign explicit format expressions "0.0" and "0.00", respectively. With both items active, expand the higher precedence item around the lower one: (8 + 3) * 2 = 22, displayed as 22.00. Swap precedence values: 8 * 2 + 3 = 19, displayed as 19.0. Use two slicers with exactly one item selected. These are predicted results; native test is required. With CALCULATE in the outer expression, the context for inner expressions can change, so simple sequential arithmetic is not a general evaluation model.
Test interactions explicitly
Check base only, each item alone, both, swapped precedence, formats, and no/multiple selections. For TimeCalc use category grand totals with one item per column; turn off totals across calculation items. Record selectionExpressionBehavior if exposed. Higher precedence format expressions can override the intended percentage format, so keep unrelated groups out of the growth lab and test the combined behavior before deployment. Never use an arithmetic group on every measure without validating type and unit. Do not change precedence in a shared model.
Practice — reverse the nesting
For Probe=12, predict both precedence orders and the displayed formats. Explain why selecting a different field cannot replace the need to test group precedence. References: https://learn.microsoft.com/en-us/analysis-services/tabular-models/calculation-groups?view=sql-analysis-services-2025; https://learn.microsoft.com/en-us/dax/selectedmeasureformatstring-function-dax; https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings; https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters