Library / The Kit

The Metronome & the Rosetta Stone: SQL + Power BI Learning Kit

Two rhythms. One way to turn practice into work you can show.

How to use this kit

Practise SQL for 20 minutes a day, and translate Tableau into Power BI one concept at a time. Speed comes from steady repetition, not from talent, which is why SQL is the metronome.

PartMemorable imageWhat it trainsTime
Metronome (SQL)A metronome does not make you a cleverer musician, it makes you steady.Thinking in SQL order, and typing it from a blank screen20 min a day, Mon-Fri
Rosetta Stone (Tableau to Power BI)One story, two scripts. You already know the story, you only need the vocabulary.Mapping what you know in Tableau onto Power BI terms3 sessions a week, 45 min

Sunday is the checkpoint: 15 minutes to write down three things you understood, one thing you got wrong, and one question for your mentor.

Metronome, part 1: think in SQL

SQL is hard to think in because you type it in one order and the database reads it in another. Think in the reading order, and picture a kitchen.

Thinking orderKeywordKitchen imageThe question you ask
1FROMOpen the fridgeWhich table holds my data?
2JOINBring a second ingredientWhich table adds what I'm missing, and on which key?
3WHEREThrow out spoiled items before cookingWhich rows do I keep?
4GROUP BYSort the food into pilesOne row per what?
5HAVINGThrow out the small piles after sortingWhich groups survive?
6SELECTPlate the dishWhich columns and calculations do I show?
7ORDER BYArrange the platesIn what order?
8LIMITServe only the first N platesHow many rows?

The one-sentence method: before typing anything, finish this sentence: “I want one row per ___, showing ___, for ___ only.” The first blank is your GROUP BY, the second is your SELECT, the third is your WHERE.

Example: “One row per month, showing orders and revenue, for completed orders in 2026 only.”

SELECT
    DATE_TRUNC('month', o.order_date) AS order_month,
    COUNT(DISTINCT o.order_id)        AS orders,
    SUM(oi.quantity * oi.unit_price)  AS revenue
FROM orders AS o
JOIN order_items AS oi
  ON oi.order_id = o.order_id
WHERE o.status = 'completed'
  AND o.order_date >= '2026-01-01'
GROUP BY DATE_TRUNC('month', o.order_date)
ORDER BY order_month;

DATE_TRUNC is the PostgreSQL and Snowflake spelling. In SQL Server use DATETRUNC(month, o.order_date) (2022 and later) or DATEFROMPARTS(YEAR(o.order_date), MONTH(o.order_date), 1).

The photocopier trap: A JOIN to the “many” side photocopies the rows of the “one” side. If you SUM an order-level amount after joining to order_items, every order is counted once per item. Always ask: what is the grain (one row per what?) of each table before I join it?

Typing speed is the wrong problem: You do not need faster fingers, you need fewer decisions per query. Keep a personal snippet library of 10 skeletons (monthly trend, top N per group, customers with no orders, running total, latest row per customer) in DBeaver, VS Code or any snippet tool, and type from the skeleton.

Metronome, part 2: the daily drill ladder

Climb one level roughly every two weeks, and stay on a level until you can write its query from a blank screen without looking. The practice data is a plain e-commerce shop: customers, orders, order_items, products.

LevelSkillImageDaily drill prompt
1SELECT, WHERE, ORDER BYWindow shoppingList completed orders above 100 EUR from last month, newest first.
2COUNT, SUM, AVG + GROUP BYPiles on the counterRevenue and order count per country.
3HAVINGPile inspectorCustomers with more than 3 orders.
4INNER JOIN vs LEFT JOINGuest list vs who actually showed upCustomers who never ordered (LEFT JOIN ... WHERE order_id IS NULL).
5CASE WHENTraffic lightLabel each order small, medium or large and count per label.
6CTE (WITH)Named scratch paperMonthly revenue in one CTE, then month-over-month growth on top.
7Window functions: ROW_NUMBER, RANK, LAG, SUM() OVERLooking out the window without leaving your seatLatest order per customer; running revenue total; change vs previous month.
8CohortsBirth monthFirst-order month per customer, then how many return in months 1, 2, 3.

The 20-minute drill:

  1. Minutes 0-3: write the one-sentence method for today's prompt.
  2. Minutes 3-15: type the query from a blank screen, no copy-paste, no AI.
  3. Minutes 15-20: compare with a reference answer, fix it, and save the clean version as a snippet.

On Fridays, retype one query from earlier in the week from memory. Retyping is the repetition that builds the rhythm.

Rosetta Stone, part 1: Tableau to Power BI

Most Tableau concepts have a Power BI twin, but a few look alike and behave differently.

TableauPower BIMemorable image
Workbook (.twb, .twbx).pbix file in Power BI DesktopThe same suitcase with a different brand
Live vs ExtractDirectQuery vs ImportLive is a webcam, Extract is a photo. Import is the photo.
Tableau Prep, data interpreterPower Query (language: M)The laundromat before the wardrobe
Joins, relationships (noodles), blendsRelationships in the Data Model (star schema)Tidying a drawer vs drawing a floor plan
Dimensions and MeasuresColumns and Measures (written in DAX)Measures are named recipes, not ingredients
Calculated FieldCalculated column (stored per row) or Measure (calculated on the fly)A stamp on every row vs a question answered live
LOD: FIXED, INCLUDE, EXCLUDECALCULATE with ALL, ALLEXCEPT, REMOVEFILTERS, VALUESCALCULATE is changing the lens you look through
Table calculations (running total, rank, % of total)Measures with CALCULATE, RANKX, window functions (WINDOW, OFFSET, INDEX), Quick measuresTableau calculates on what you see, DAX calculates on the model
Filters, context filters, order of operationsSlicers, Filters pane (visual, page, report), filter contextThe room you are standing in decides what you can see
ParametersWhat-if parameters, Field parametersA dial on the wall that the viewer can turn
Dashboard, StoryReport page, BookmarksA page in a book
Actions (filter, highlight, URL)Cross-filtering, Edit interactions, Drill-through, Tooltip pagesVisuals talking to each other by default
Tableau Cloud or ServerPower BI Service (workspaces, apps)The shared kitchen vs your home kitchen
Extract refreshScheduled refresh, with an On-premises data gateway for local sourcesThe delivery truck that restocks the fridge
User filtersRow-level security (RLS) rolesA key card that opens only some doors

Naming trap: In the Power BI Service a Dashboard is a canvas of pinned tiles from reports, not what Tableau calls a dashboard. What Tableau calls a dashboard is closest to a report page.

Rosetta Stone, part 2: the three layers and the big shift

Tableau starts from the view and lets the data shape follow. Power BI starts from the model and lets the views follow. Build the model once, and every visual afterwards is cheap.

  1. Power Query (M): the laundromat. Clean and reshape the data before it enters the model: types, merges, unpivots, filters.
  2. Data Model (star schema): the floor plan. One fact table in the middle (orders, order_items), dimension tables around it (customers, products, a Date table), joined by relationships. Think of a star: facts at the centre, descriptions on the points.
  3. DAX measures: the recipes. Written once, they recalculate for whatever the viewer selects.
  4. Visuals: the plating. Drag fields, no logic needed.

Two contexts, two pictures: Filter context is the room you are standing in: whatever slicers, axis values and filters apply to this cell. Row context is the line you are reading: one row at a time, as in a calculated column or an iterator such as SUMX.

Where your SQL goes: GROUP BY does not exist in DAX because the visual does it: the field on the axis is the GROUP BY, the measure is the aggregate in SELECT, and a slicer is the WHERE.

Revenue = SUMX ( order_items, order_items[quantity] * order_items[unit_price] )
Orders = DISTINCTCOUNT ( orders[order_id] )
AOV = DIVIDE ( [Revenue], [Orders] )
Revenue LY = CALCULATE ( [Revenue], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
Revenue % of All Customers =
    DIVIDE ( [Revenue], CALCULATE ( [Revenue], REMOVEFILTERS ( customers ) ) )

The Tableau FIXED LOD for first order date per customer, {FIXED [Customer ID] : MIN([Order Date])}, becomes a calculated column on orders:

First Order Date =
    CALCULATE ( MIN ( orders[order_date] ), ALLEXCEPT ( orders, orders[customer_id] ) )

Date table: Tableau builds date hierarchies for you. In Power BI create one Date table, mark it as the date table, and relate it to your fact table. Time intelligence functions such as SAMEPERIODLASTYEAR need it.

12-week plan

The metronome climbs the SQL ladder while the Rosetta Stone climbs the Power BI layers, and each pair ends with something concrete to show your mentor.

WeeksMetronome (SQL, 20 min a day)Rosetta Stone (Power BI, 3 x 45 min a week)Show your mentor
1-2Levels 1-2: SELECT, WHERE, GROUP BYPower BI Desktop tour; Import vs DirectQuery; load one familiar e-commerce datasetYour one-sentence method on 5 queries
3-4Levels 3-4: HAVING, JOINPower Query (M) basics; first star schema and relationshipsA model diagram with the grain of each table
5-6Levels 5-6: CASE WHEN, CTEDAX basics: measures vs columns, SUMX, DIVIDE, CALCULATERevenue, Orders, AOV as measures, matching your SQL numbers
7-8Level 7: window functionsFilter context, Date table, time intelligenceMonth-over-month and year-over-year, in SQL and in DAX
9-10Level 8: cohorts and retentionRebuild one of your old Tableau dashboards end to end in Power BISide-by-side screenshots plus a list of what behaved differently
11-12Mixed timed drills: 3 queries in 20 minutesPublish to the Power BI Service; RLS; scheduled refreshA one-page case study you could post publicly

Checkpoint rule: Every number you build in Power BI is checked against the same number from a SQL query. When they disagree, you have found the lesson of the week.

Resources and what to build on the side

This list is from memory; check each link is current before investing time.

AreaResourceUse it for
SQL drillsSQLBolt, SQLZoo, Mode SQL TutorialLevels 1-4 in short interactive lessons
SQL practiceLeetCode SQL 50, DataLemur, StrataScratchLevels 4-8 with analytics-style questions
SQL bookSQL for Data Analysis (Cathy Tanimura)Cohorts, retention and time-series patterns from real analytics work
Power BI pathMicrosoft Learn: Microsoft Power BI Data Analyst (PL-300) learning pathThe official map of the Rosetta Stone, free
DAXDAX.guide, SQLBI articles and videos (Marco Russo, Alberto Ferrari)Looking up functions; understanding filter context properly
Power BI channelsGuy in a Cube, RADACADShort how-to videos while you build
ToolsDAX Studio, Tabular Editor, DBeaverTesting DAX, editing models, running SQL with snippets

Questions to bring to your mentor

  • Which five business questions should I be able to answer with SQL alone, in any job?
  • When I get a number, how do I decide whether to trust it?
  • How do I explain a metric's definition so nobody argues about it later?
  • Which of my Tableau habits should I keep, and which should I unlearn?
  • What would you build in my position if you had one hour a week?

Three seeds for the side project

  1. Same question, three tools: publish each analysis as SQL, then Power BI, then Tableau, with one picture per concept.
  2. A metric dictionary: for each metric write its name, its grain, the SQL and the DAX. Tools change, but clear definitions of what a metric means stay valuable.
  3. One concept a week: explain one idea with one image. Teaching in public is how the imposter feeling keeps shrinking.

Tools are the instrument; grain, model and the question are the score, and the score survives every instrument change.