Creating A Quiz In Power BI

This blog lays out the core patterns - data model, slicers, measures, and UX - so anyone can adapt the idea to their dataset.

Core Concept

Pattern: keep your quiz logic in disconnected tables (no relationships), then use measures to pull the “current question” and evaluate answers.

Why:

  • Disconnected tables are immune to other page slicers; your quiz won’t break if the report has filters elsewhere.
  • Measures read from your question bank deliberately, so behaviour is predictable.
  • Easy to swap question types (year, trivia, anything) without rebuilding relationships.

Data Model: Minimal, Flexible, Reusable

1) Question Bank (calculated/imported table)

One row = one question. Keep it simple and generic:

Columns:

QuestionID (number) used for Stable ID indexing

QuestionText (text) is the prompt shown to the user

QuestionType (text) is the multiple choice questions / truefalse / shortext logic

CorrectAnswer (text/number) is what counts as correct

2) Quiz Controls (disconnected)

  • Question Picker: either a What-if parameter table (1..N) or a simple GENERATESERIES(1,N,1) table for a slider/slicer.
  • Reveal Toggle: tiny manual table with values Hide / Reveal.
  • User Choice (for MCQ/TrueFalse): a small table the user selects from - e.g., AnswerChoices[Answer] with {A,B,C,D} or {TRUE,FALSE}.

No relationships needed. You’ll filter the question bank via measures.

UI Flow You Can Reuse Anywhere

  1. Pick a question (slider or “Next” buttons).
  2. Show the prompt (optionally masked).
  3. Let the user choose an answer (buttons/tiles).
  4. Reveal (and score).

This works for: guessing a year, picking a prime, choosing a definition - anything.

Generic Measures (Templates with Placeholders)

Replace table/column names in 'Questions'[], 'Picker'[], 'Reveal'[], 'AnswerChoices'[] with yours.

1) Read the selected QuestionID

2) Pull the current question and answer

Why use FILTER + CALCULATE? It clearly targets one row by QuestionID, and adapts to any question bank shape.

3) Masking (optional “reveal later” pattern)

Mask any sensitive token (e.g., a year, a keyword) only when hidden.

Why mask? Makes a “guess first, reveal later” flow without bookmarks.

4) Reveal switch

5) User’s selected answer (for MCQ / True/False)


6) Correctness & feedback

Why store correctness as a measure? It recalculates instantly with slicer changes; no state to manage.

Multiple-Choice Layout (Generic)

  • Slicer (tiles) → AnswerChoices[Answer] (A/B/C/D or TRUE/FALSE).
  • Card (prompt) → QuizPromptToShow.
  • Buttons → Reveal[Mode] (Hide/Reveal).
  • Card (feedback) → FeedbackText.
  • (Optional) Options table visual if your options come from a child table:
    • Add a table visual with options filtered by QuestionID = [CurrentQuestionID].

Random vs Deterministic

  • Deterministic (recommended for demos): slider/parameter picks QuestionID. Clean and repeatable.
  • Random: RANDBETWEEN(1,N) for CurrentQuestionID. Fun, but it re-rolls whenever the page recalculates.

Scoring (Session-style)

Power BI doesn’t persist user state. A lightweight pattern is to score current selection only:

If you want a short quiz of K questions, create a small IndexList table (1..K), and store a per-index choice in a disconnected table, then sum correctness across indices. (That’s more advanced; the key rule still holds: keep it disconnected and compute with measures.)

Accessibility & UX Tips

  • Tiles for slicers (bigger hit targets).
  • Edit interactions so other report slicers don’t interfere with the quiz page.
  • Help panel with bookmarks (Data = Off) for a clean show/hide “How to use”.
  • Readable fonts (Segoe UI / Calibri), high-contrast colours, and enable word wrap on cards.
  • Instructions at the top: “1) Pick a question. 2) Choose an answer. 3) Reveal.”

Quick Build Checklist

  1. Create a QuestionBank (one row per question, with QuestionID, QuestionText, CorrectAnswer).
  2. Add a Picker table (1..N) for the slider; no relationships.
  3. Add Reveal and (if needed) AnswerChoices tables; no relationships.
  4. Write measures to:
  • read current QuestionID,
  • fetch prompt and correct answer,
  • mask text (optional),
  • evaluate correctness,
  • show feedback.
  1. Build the page (tiles, card, reveal toggle).
  2. Test edge cases (no selection, wrong selection, masking targets).

Author:
Tyler McKillop
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab