Start with the decision, not the formula
Power BI is useful when someone needs a dependable answer from data: Which product line is growing? How did sales change this month? Which class has an attendance concern? DAX is the calculation language that lets a report answer those questions consistently.
It is not a substitute for clean data. A trustworthy report follows a sequence: collect records, clean and shape them, build a model, define calculations, then design visuals around real decisions. If a number cannot be traced back to a clear business definition, a polished chart will not make it reliable.
Know the three calculation choices
| Choose this | Use it when | Example |
|---|---|---|
| Measure | The answer should change as a report is filtered. | Total sales for the selected month, region or product. |
| Calculated column | Each row needs a stored label or value for grouping, sorting or relationships. | A price band, delivery status or a year-month key. |
| Calculated table | The model needs a new table derived from existing data. | A date table or a small summary table. |
For most report totals, start with a measure. Measures are dynamic: the same formula can show total sales for all time, one branch or one category depending on the filters currently applied. Calculated columns evaluate one source row at a time and take space in the model, so use them deliberately.
Model before you calculate
A model describes the meaning and relationship of the tables behind a report. A simple sales model often has one fact table—many transaction rows—and supporting dimensions such as Date, Product, Customer or Location. The fact table holds measurable events; the dimension tables give those events context.
- Set the grain: state what one row in the fact table represents, such as one order line or one learner attendance event.
- Use stable keys: connect tables with identifiers rather than names that may change or repeat.
- Prefer a star shape: let dimensions filter the fact table through clear, one-to-many relationships.
- Make dates usable: connect a proper date table when reporting by month, quarter or year.
Take time to remove duplicate headers, inconsistent spellings, blank keys and accidental totals from source files in Power Query before writing DAX. Formula-writing is much easier once the model tells the truth.
Write three first measures
Imagine a Sales table with Sales Amount, Quantity and Order ID columns. Create measures in the model and give each one a business-friendly name.
Total Sales = SUM(Sales[Sales Amount])
Total Quantity = SUM(Sales[Quantity])
Average Order Value =
DIVIDE([Total Sales], DISTINCTCOUNT(Sales[Order ID]))
The square brackets in [Total Sales] refer to another measure. DIVIDE is preferable to the slash operator for ratios because it handles a zero denominator safely. Add these measures to cards and a table with Date and Product fields, then change a slicer. The totals should respond to the filter selection without rewriting the formula.
Understand filter context in plain language
Filter context is simply the part of the model a measure is being asked to consider. A report page filtered to “Port Harcourt” and “September” gives a measure a smaller, specific set of rows. A measure such as [Total Sales] recalculates against that set.
This is why a measure is more than a stored number. It is a reusable business definition. Write the definition once, then allow a report reader to explore it by date, category, branch or another valid dimension. Test a measure in a table before trusting it in a KPI card; row-level checks quickly reveal missing relationships or unexpected filters.
Use variables to make important calculations readable
As formulas grow, variables make the logic easier to review and less error-prone. The following measure names the two values before calculating a margin.
Profit Margin =
VAR Revenue = [Total Sales]
VAR Profit = [Total Profit]
RETURN
DIVIDE(Profit, Revenue)
Use clear measure names, format currency and percentages correctly, and put related measures in display folders if the model becomes large. Good DAX is code that another analyst can understand, test and maintain.
A 30-minute practice routine
- Choose a small, non-sensitive sales, attendance or inventory dataset.
- Write one sentence defining the grain of the main table.
- Create a Date table and connect it to the fact table if dates are available.
- Create
Total Sales,Total Quantityand one safe ratio usingDIVIDE. - Place the measures in a table with one category field and check that totals match the source data.
- Add a date or category slicer and explain in words why each number changed.
Common beginner mistakes
- Creating a calculated column for every total instead of using a measure.
- Writing calculations before confirming the table grain and relationships.
- Mixing two different definitions of a metric, such as sales before and after returns.
- Using a dashboard visual without testing the same measure in a simple table first.
- Sharing source files containing personal, financial or confidential information without permission.
Continue your data-analysis path
Use the companion manual for a fuller guided course on the same foundations, then continue with the SQL for Data Analysis guide to understand tables and queries. Learners and organizations who want instructor-led support can explore JENECONK data-analysis training.
Study companion: Download “Power BI DAX — From Complete Beginner to Professional (Volume 1)” (PDF). Use the guide above to practise the core ideas first; the PDF expands the lessons and exercises.