CY / PY Toggle

Current Year / Previous Year Comparison

Build

Build

cy-poy-toggle

Overview

Features

Prompts

Help

Key Features

A chart showing 2024 almost always invites the next question — how does that compare to 2023? Building that toggle by hand is a chore: you need a little parameter table for the two buttons, a year-shifting version of every measure on the chart, a title that updates with the selection, a button slicer styled to match the page, and interaction rules so the new buttons don't disturb anything else — all without upsetting the year slicer you already have. It's the better part of an hour, done right.

This skill builds the whole thing in one go, and it keeps step with your year slicer automatically — pick any year and PY always shows the one before it — run it with /cy-py-toggle.

How it works

Type /cy-py-toggle, point it at your chart, and it does the rest:

  1. Looks at your model — finds your calendar table, your year slicer, the measures on the chart, and how the chart is styled

  2. Confirms two things — which measures to shift, and which folder the new measures should live in

  3. Builds the comparison — a year-shifted version of each measure that shows this year or last year depending on the button

  4. Adds a self-updating title — reads like "Revenue Current Year 2024" or "Revenue Previous Year 2023" as you toggle

  5. Points the chart at it — swaps the chart over to the new measures and wires up the title

  6. Drops in the buttons — a compact CY / PY slicer in the chart's top-right corner, styled to match your page, starting on CY

  7. Keeps it tidy — the buttons only affect this one chart, and nothing else on the page can change them

  8. Follows bookmarks — if the chart shows and hides with a bookmark, the buttons are grouped with it so they come and go together

What you get

  • A CY / PY button — a compact two-button slicer in the chart's top-right corner, matching your page style, starting on CY

  • A chart that follows the button — CY shows the selected year, PY shows the year before

  • A self-updating title — "Revenue Current Year 2024" or "Revenue Previous Year 2023", switching with the button

  • Year-shifted measures — one per measure on the chart, so the comparison is correct for whatever's plotted

  • Clean interactions — the buttons drive only this chart and stay out of everyone else's way

  • Bookmark grouping — set up for you when the chart is shown and hidden by a bookmark

Tool Information

Skill

39 USD

Bundle (All skills)

129 USD

Category

Build

Version

Version 3.2.2.2

or log in if you already have an account