Module 1: Getting started · Lesson 1.5 · about 10 min
How to practise DAX in this course
Every lesson has a DAX editor that runs in your browser on the Northbay model. Learn to run code, read errors, check your answer and watch step by step what a formula did to the data.
Module 1 · about 10 minutes. You’ll be able to use the practice editor: write measures, read errors, check answers and replay what happened.
1. Why this matters
You learn DAX by writing it, getting it wrong and seeing why. The editor in every lesson gives you instant feedback without installing anything, and it shows you what is usually invisible: which rows a formula can see.
2. Write and run
Type a measure as a name, an equals sign and a formula, one per line. Press Run or Ctrl+Enter. Tab indents; press Esc then Tab to move out of the box.
Add a second measure on a new line: Units = SUM(Sales[Quantity]). Run it, then press Check my answer.
Press Run to see the result.
Each measure goes on its own line: a name, an equals sign, then the formula. Column names go in square brackets after the table name.
Total Sales = SUM(Sales[Amount])
Units = SUM(Sales[Quantity]) What you can write:
- Measures:
Total Sales = SUM(Sales[Amount]). Names can have spaces. Use a measure in another one with square brackets:[Total Sales]. - Calculated columns:
Sales[Margin] = Sales[Amount] - Sales[Quantity] * Sales[UnitCost](Lesson 3.4). - Queries:
EVALUATEfollowed by a table, such asEVALUATE VALUES(Product[Category])(Lesson 5.7).
Comments start with // or --.
3. See what happened
The best part. Run this, click the Home row, then Show me what happened:
Run this, click the Home row in the result, then press Show me what happened and step through it.
Press Run to see the result.
Step 1 shows the filter context: the Home row of the visual filters the Product table to 3 products, and the filter flows along the relationship to Sales, leaving only Home order lines. Step 2 shows SUM adding up the Amount of the rows that are left. Kept rows are highlighted; filtered rows are faded with a line through them. Every DAX lesson uses this view.
4. Read the error, fix the code
Errors are written to tell you what to do. Run this one, read the message and fix it:
This measure has an error. Run it, read the message, and fix it so it adds up the Amount column.
Press Run to see the result.
A measure has no "current row", so a bare column means nothing. Wrap it in an aggregation: SUM( ... ).
Total Sales = SUM(Sales[Amount]) Principle
Principle: a measure is evaluated in a filter context (which rows are visible) and has no current row. That’s why Sales[Amount] on its own fails in a measure but works in a calculated column, where there is a current row. Lessons 4.3 and 5.5 build on this one idea.
About the engine: this is a teaching engine written for the course. It follows Microsoft’s documented DAX rules and covers the functions the course uses (the full list is under the playground editor), with single-direction, one-to-many relationships. Power BI itself has many more functions; everything you learn here works there unchanged.
5. Practice
- In the first editor, add
Lines = COUNTROWS(Sales)and split byStore[Store]. - In the playground, split by
'Date'[Weekday]. Which weekday sells most? - Write a measure with a typo in a column name. What does the error suggest?
Answers
- One row per store with Total Sales, Units and Lines.
- Saturday and Sunday are highest: Northbay’s weekends are about a third busier.
- It lists the table’s real columns so you can spot the right name.
Check yourself
Your ticks stay in this browser. Save them as a file on the course home.
Updated 2026-11-22. Northbay Goods is a made-up shop and its numbers are generated. Power BI changes every month: menu names can move, so check Microsoft Learn if a button is not where the lesson says. The practice editor runs in your browser; nothing you type is sent anywhere.