Absolute / Percentage Toggle

# / % Switch for Chart Visuals

Build

Featured Image

Overview

Features

Prompts

Troubleshooting

Key Features

Your bar chart shows total sales, but stakeholders also want to see each segment as a percentage. Maintaining two separate visuals doubles the report surface and drifts out of sync. Building the toggle manually means creating a disconnected parameter table, a switch measure with `formatStringDefinition`, a tile slicer, a dynamic title measure, and interaction restrictions — and getting the TMDL indentation rules wrong silently breaks the format string at runtime. This skill builds all of it in one command.

How it works

Type `/abs-pct-toggle`, provide the chart ID, base measure, and percentage variant, and the skill handles everything:

  1. Checks `database.tmdl` compatibility level and upgrades to 1601 if needed

  2. Creates a disconnected `prmAggregation` table with `#` and `%` rows (reuses if already present)

  3. Adds a switch measure with `formatStringDefinition` to the measure table

  4. Adds a dynamic title measure — absolute and percentage titles derived from the chart's fields

  5. Updates the target chart's Y-axis to use the switch measure and wires the dynamic title

  6. Creates a tile slicer above the chart, sized and styled to match existing page slicers

  7. Sets interaction rules so the slicer only filters the target chart

What you get

  • prmAggregation table — disconnected two-row table shared across all toggles on the model

  • Switch measureIF(SELECTEDVALUE(Order, 1) = 2, [PctExpr], [BaseMeasure]) with formatStringDefinition that changes the number format on toggle

  • Title measure — returns the absolute or percentage title string depending on the selection

  • Updated chart visual — Y-axis references the switch measure; title bound to the title measure

  • Tile slicer — positioned directly above the chart, right-aligned, styled to match the page

  • Scoped interactions — the slicer filters only the target chart

Tool Information

Price

20 USD

Category

Build

Version

Version 1.0.0.2.13