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.
| Part | Memorable image | What it trains | Time |
|---|---|---|---|
| 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 screen | 20 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 terms | 3 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 order | Keyword | Kitchen image | The question you ask |
|---|---|---|---|
| 1 | FROM | Open the fridge | Which table holds my data? |
| 2 | JOIN | Bring a second ingredient | Which table adds what I'm missing, and on which key? |
| 3 | WHERE | Throw out spoiled items before cooking | Which rows do I keep? |
| 4 | GROUP BY | Sort the food into piles | One row per what? |
| 5 | HAVING | Throw out the small piles after sorting | Which groups survive? |
| 6 | SELECT | Plate the dish | Which columns and calculations do I show? |
| 7 | ORDER BY | Arrange the plates | In what order? |
| 8 | LIMIT | Serve only the first N plates | How 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.
| Level | Skill | Image | Daily drill prompt |
|---|---|---|---|
| 1 | SELECT, WHERE, ORDER BY | Window shopping | List completed orders above 100 EUR from last month, newest first. |
| 2 | COUNT, SUM, AVG + GROUP BY | Piles on the counter | Revenue and order count per country. |
| 3 | HAVING | Pile inspector | Customers with more than 3 orders. |
| 4 | INNER JOIN vs LEFT JOIN | Guest list vs who actually showed up | Customers who never ordered (LEFT JOIN ... WHERE order_id IS NULL). |
| 5 | CASE WHEN | Traffic light | Label each order small, medium or large and count per label. |
| 6 | CTE (WITH) | Named scratch paper | Monthly revenue in one CTE, then month-over-month growth on top. |
| 7 | Window functions: ROW_NUMBER, RANK, LAG, SUM() OVER | Looking out the window without leaving your seat | Latest order per customer; running revenue total; change vs previous month. |
| 8 | Cohorts | Birth month | First-order month per customer, then how many return in months 1, 2, 3. |
The 20-minute drill:
- Minutes 0-3: write the one-sentence method for today's prompt.
- Minutes 3-15: type the query from a blank screen, no copy-paste, no AI.
- 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.
| Tableau | Power BI | Memorable image |
|---|---|---|
| Workbook (.twb, .twbx) | .pbix file in Power BI Desktop | The same suitcase with a different brand |
| Live vs Extract | DirectQuery vs Import | Live is a webcam, Extract is a photo. Import is the photo. |
| Tableau Prep, data interpreter | Power Query (language: M) | The laundromat before the wardrobe |
| Joins, relationships (noodles), blends | Relationships in the Data Model (star schema) | Tidying a drawer vs drawing a floor plan |
| Dimensions and Measures | Columns and Measures (written in DAX) | Measures are named recipes, not ingredients |
| Calculated Field | Calculated column (stored per row) or Measure (calculated on the fly) | A stamp on every row vs a question answered live |
| LOD: FIXED, INCLUDE, EXCLUDE | CALCULATE with ALL, ALLEXCEPT, REMOVEFILTERS, VALUES | CALCULATE is changing the lens you look through |
| Table calculations (running total, rank, % of total) | Measures with CALCULATE, RANKX, window functions (WINDOW, OFFSET, INDEX), Quick measures | Tableau calculates on what you see, DAX calculates on the model |
| Filters, context filters, order of operations | Slicers, Filters pane (visual, page, report), filter context | The room you are standing in decides what you can see |
| Parameters | What-if parameters, Field parameters | A dial on the wall that the viewer can turn |
| Dashboard, Story | Report page, Bookmarks | A page in a book |
| Actions (filter, highlight, URL) | Cross-filtering, Edit interactions, Drill-through, Tooltip pages | Visuals talking to each other by default |
| Tableau Cloud or Server | Power BI Service (workspaces, apps) | The shared kitchen vs your home kitchen |
| Extract refresh | Scheduled refresh, with an On-premises data gateway for local sources | The delivery truck that restocks the fridge |
| User filters | Row-level security (RLS) roles | A 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.
- Power Query (M): the laundromat. Clean and reshape the data before it enters the model: types, merges, unpivots, filters.
- 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.
- DAX measures: the recipes. Written once, they recalculate for whatever the viewer selects.
- 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.
| Weeks | Metronome (SQL, 20 min a day) | Rosetta Stone (Power BI, 3 x 45 min a week) | Show your mentor |
|---|---|---|---|
| 1-2 | Levels 1-2: SELECT, WHERE, GROUP BY | Power BI Desktop tour; Import vs DirectQuery; load one familiar e-commerce dataset | Your one-sentence method on 5 queries |
| 3-4 | Levels 3-4: HAVING, JOIN | Power Query (M) basics; first star schema and relationships | A model diagram with the grain of each table |
| 5-6 | Levels 5-6: CASE WHEN, CTE | DAX basics: measures vs columns, SUMX, DIVIDE, CALCULATE | Revenue, Orders, AOV as measures, matching your SQL numbers |
| 7-8 | Level 7: window functions | Filter context, Date table, time intelligence | Month-over-month and year-over-year, in SQL and in DAX |
| 9-10 | Level 8: cohorts and retention | Rebuild one of your old Tableau dashboards end to end in Power BI | Side-by-side screenshots plus a list of what behaved differently |
| 11-12 | Mixed timed drills: 3 queries in 20 minutes | Publish to the Power BI Service; RLS; scheduled refresh | A 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.
| Area | Resource | Use it for |
|---|---|---|
| SQL drills | SQLBolt, SQLZoo, Mode SQL Tutorial | Levels 1-4 in short interactive lessons |
| SQL practice | LeetCode SQL 50, DataLemur, StrataScratch | Levels 4-8 with analytics-style questions |
| SQL book | SQL for Data Analysis (Cathy Tanimura) | Cohorts, retention and time-series patterns from real analytics work |
| Power BI path | Microsoft Learn: Microsoft Power BI Data Analyst (PL-300) learning path | The official map of the Rosetta Stone, free |
| DAX | DAX.guide, SQLBI articles and videos (Marco Russo, Alberto Ferrari) | Looking up functions; understanding filter context properly |
| Power BI channels | Guy in a Cube, RADACAD | Short how-to videos while you build |
| Tools | DAX Studio, Tabular Editor, DBeaver | Testing 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
- Same question, three tools: publish each analysis as SQL, then Power BI, then Tableau, with one picture per concept.
- 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.
- 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.