Animated KPI Cards in Qlik

Each card is just one image. Yes, really.

Recreating Power BI's new KPI cards in Qlik Sense — and making them animate.

Power BI's November 2026 update added native KPI cards with trend charts. A good idea in one tool is usually a good idea in the other — so I rebuilt it in Qlik Sense, then went one step further: the card animates. No extension, no custom front-end code — just one SVG written by Qlik script variables and shown as a Button's background image.

Intermediate2 min readUpdated November 2026

Video

See the Animated KPI Cards in Qlik

Watch the Revenue card on a Qlik Sense sheet, alongside Country and Month selections.

Screen recording only — not a live Qlik connection.

How it works

One image

The whole card is an SVG built by Qlik script variables, shown as a Button background image. No extension, no custom front-end code.

One variable

The button stores the state (open/closed) and the press time in one number, so the card only animates right after a press.

Built from blocks

Colours, sizes and measures live in variables — change once, every card follows.

Step-by-step guide

Four script tabs take you from variables to a static KPI, to monthly bars, to the full animated switch.

  1. Setup — colours, sizes, measures and number formats

    Define the palette, card dimensions, and reusable measure expressions once in the load script. Every card step references these variables, so changing a colour or format updates every card automatically.

    ///$tab Setup

    ///$tab Setup
    /*
    REVENUE CARD - step-by-step guide
    The card is an SVG image built from variables and shown as the
    background image of a Button. Follow the tabs in order:
    Setup colours, sizes, measures (used by all steps)
    Step 1 static card: Revenue KPI + "vs last month"
    Step 2 static card: KPI on the left, monthly bars + "vs Target"
  2. Step 1 — Static card: Revenue KPI + vs last month

    Start with a clean, static SVG card that centres the headline Revenue figure and shows the month-over-month delta below it. Because it is a plain data URI, you can verify layout and number formatting before adding bars or motion.

    Static preview — collapsed card

    RevenueJan - Nov 20261.33Mvs last month +2.7%vs Target 102.6%JFMAMJJASON
    ///$tab Step 1 - KPI

    ///$tab Step 1 - KPI
    /*
    STEP 1 - static card: Revenue KPI + "vs last month"
    Result: vCard_Step1
    Sheet: Button > Styling > Background image > URL as expression (fx),
    e.g. =$(vCard_Step1). Size: fit. Label: empty.
    */

    On the sheet

    Button > Styling > Background image > URL as expression (fx): =$(vCard_Step1); size fit; empty label.

  3. Step 2 — Static card: KPI on the left, monthly bars + vs Target

    Next, build the expanded layout: shrink the KPI into the left half, add the vs Target indicator underneath, and draw the 11 monthly bars with a light baseline and month initials on the right.

    Static preview — expanded card

    RevenueJan - Nov 20261.33Mvs last month +2.7%vs Target 102.6%JFMAMJJASON
    ///$tab Step 2 - Bars

    ///$tab Step 2 - Bars
    /*
    STEP 2 - static card: KPI on the left, monthly bars + "vs Target"
    Result: vCard_Step2
    Sheet: change the button's background image URL to =$(vCard_Step2)
    */
    // "vs Target": green at or above 100%, red below

    On the sheet

    Button > Styling > Background image > URL as expression (fx): =$(vCard_Step2); size fit; empty label.

  4. Step 3 — Animation: switch, button action and transition

    Combine both states with SVG animations driven by a single variable, vRevPress. Its parity stores open/closed and its timestamp tells the card whether the button was just pressed, so filter selections update instantly without replaying the animation.

    Interactive preview — click the switch

    RevenueJan - Nov 20261.33Mvs last month +2.7%vs Target 102.6%JFMAMJJASON

    Try a filter: the card updates, it doesn't replay the animation.

    ///$tab Step 3 - Animation

    ///$tab Step 3 - Animation
    /*
    STEP 3 - animated card: Step 1 layout <-> Step 2 layout
    Result: vCard_Revenue
    Sheet: the same Button
    Background image URL (fx): =$(vCard_Revenue)
    Action: Set variable value

    On the sheet

    Button > Styling > Background image > URL as expression (fx): =$(vCard_Revenue); size fit; empty label.

    Button action: Set variable value · Variable vRevPress · Value =Floor(Now()*86400)*2 + If(Mod(vRevPress,2)=1,0,1)

Gotchas I hit

When a SET value is one quoted string, Qlik strips the outer quotes. Wrap text pieces in parentheses ( ) so the quotes survive.

Which Power BI visual should I rebuild in Qlik next?

Send me a message on LinkedIn with your suggestion, or grab the complete Qlik load script below and try it in your own app.

Message me on LinkedIn

About Robert Mika

Qlik developer sharing practical SVG techniques

Follow on LinkedIn