Skip to content
Power BI & Excel

DAX for Beginners (2026): 12 Power BI Formulas to Learn First

A plain-English guide to DAX for beginners: where to write formulas in Power BI, when to use measures, how CALCULATE changes a number, and the twelve functions worth learning first.

DAX for beginners cover: 12 Power BI formulas to learn first, with a SUM measure and a rising bar chart

Quick answer

DAX for beginners rests on three habits: write explicit measures instead of calculated columns, understand that filter context decides every number, and use CALCULATE to change that context on purpose. Learn about twelve functions first, such as SUM, DIVIDE, SUMX, RELATED, CALCULATE and CALENDARAUTO, then test them in DAX query view.

Key takeaways

  • Use measures for totals and ratios; they run at query time and are never stored.
  • Every DAX result depends on filter context, so the same measure shows different values in different visuals.
  • CALCULATE adds, replaces or removes filters, which is how you build shares of total and period comparisons.
  • Time intelligence needs a proper date table, which CALENDARAUTO can create in one line.
  • Use DIVIDE instead of a slash and VAR to make long formulas faster and easier to debug.
  • Copilot can write and explain DAX queries, but you still need to check the logic yourself.

DAX for beginners comes down to three ideas: write measures instead of extra columns, understand that every number is calculated inside a filter, and learn CALCULATE well enough to change that filter on purpose. Once those click, a short list of about twelve functions covers most of the reports you will build in your first year with Power BI.

This DAX for beginners guide is written the way I explain formulas to students in class. We will not try to memorise every function. You will learn how a formula is put together, which functions earn their place, why the same measure shows different values in different visuals, and the mistakes that waste most of a beginner's time. Every code example uses a small, made-up shop model so you can copy the pattern into your own file.

What Is DAX, and Why Does It Feel Hard at First?

DAX stands for Data Analysis Expressions. Microsoft's DAX basics quickstart describes it as a set of functions, operators and constants that you combine in formulas to calculate new values from data already in your model. You can build a simple report without it. You need it the moment someone asks for growth over last year, profit margin, or a share of total. Power BI DAX formulas are what turn a plain sales table into those answers.

Most beginners arrive from Excel, and that is where the confusion starts. An Excel formula points at cells: =B2*C2. A DAX formula never points at a cell. It points at whole columns and tables, and the result depends on which rows are visible at that moment. Microsoft's quickstart makes the same point: DAX functions take a complete column or table, and you use filters to narrow the values down. It also says that you rarely need a VLOOKUP-style lookup, because the relationships in your model already connect the tables.

So the hard part is not the syntax. The syntax is close to Excel. The hard part is the mental shift from "this cell" to "these rows, under these filters". If you have taught yourself the Excel formulas every office job needs, you already have half the skill. This guide gives you the other half.

Where Do You Write DAX in Power BI?

Power BI Desktop gives you three places to write DAX, and each one has a different job.

  • The formula bar. Select a table in the Data pane, choose New measure or New column, and type your formula. This is where you will spend most of your first month.
  • DAX query view. A full editor where you run queries that return a table of results. According to Microsoft's DAX query view documentation, queries read data from the model but do not create visuals or model items unless you choose to save a measure back.
  • TMDL view. A code view of the whole model definition. It is useful later, when you manage many measures at once. You can safely ignore it in week one.

DAX query view is the tool I wish every beginner opened earlier. It lets you test a measure and see the raw numbers before you build a single chart. A query has two parts. EVALUATE is required and says what to return. DEFINE is optional and lets you create a measure that exists only inside that query.

DEFINE
    MEASURE Sales[Total Sales] = SUM ( Sales[Amount] )
EVALUATE
    SUMMARIZECOLUMNS ( 'Product'[Category], "Total", [Total Sales] )

Right-click any measure in the Data pane and choose a quick query such as Evaluate, and Power BI writes the query for you. When you like the result, the Update model link above the definition saves the measure into your model. Two shortcuts worth learning on day one are Shift+Alt+F to format a query and Ctrl+/ to comment a line out.

Measures vs Calculated Columns (and Calculated Tables): Which Should You Use?

This is the first real decision in DAX, and getting it wrong is the most common reason a beginner's file grows slow and large. Microsoft's training module on DAX calculation types describes three kinds of model calculation. Here they are side by side.

Type What it returns When it is calculated Stored in the model? Typical use
Measure One value for the current filter context At query time, when a visual asks for it Never Totals, averages, ratios, growth
Calculated column One value per row At data refresh (Import mode) Yes, adds to model size A row label you slice by, such as an age band
Calculated table A whole new table At data refresh Yes, always Date tables and what-if parameters

The rule I give students is simple. If the answer should change when the user clicks a slicer, it is a measure. If you need to put the value on a slicer, an axis or a relationship, it may need to be a column. Even then, ask whether Power Query or the source system could create it instead, because a calculated column in Import mode makes the file bigger.

Measure vs calculated column vs calculated table in Power BI DAX: what each returns, when it runs and whether it is stored
Measures, calculated columns and calculated tables differ in what they return, when they run and whether they are stored.

Tip: Microsoft's module notes that "calculated measure" is not a real term in tabular modelling. The word "calculated" belongs only to tables and columns. Using the right names makes job interviews and the PL-300 exam easier, because questions are worded with exactly these terms.

Explicit and implicit measures

When you drag a numeric column onto a visual and Power BI sums it, that is an implicit measure. It shows a sigma symbol in the Data pane. A measure you write yourself is an explicit measure and shows a calculator icon. Write explicit measures from the start. They are easier to reuse, rename, format and explain to the next person who opens your file.

How to Read a DAX Formula, Part by Part

The DAX basics quickstart breaks a simple measure into its parts. Using our shop model, the first measure most people write looks like this:

Total Sales = SUM ( Sales[Amount] )
  1. Total Sales is the measure name. Pick names a manager can read, not codes.
  2. = starts the formula.
  3. SUM is the function.
  4. ( ) hold the arguments you pass to the function.
  5. Sales is the table, and [Amount] is the column. Written together, Sales[Amount] is a fully qualified column name.

Two habits from the same Microsoft page will save you hours. First, always include the table name before a column, even when the column sits in the same table. Second, wrap table names in single quotes when they contain spaces, such as 'Sales Order'[Channel]. The quickstart also warns that correct syntax can still give a wrong number. A formula that runs is not proof that it is right.

One more detail surprises people. Power Query is case sensitive, but DAX is not. sum and SUM behave the same way once data is in the model.

DAX for Beginners: The 12 Functions to Learn First

The DAX reference lists far more functions than any beginner needs. In my experience, these twelve cover the bulk of real business reports. I have grouped them by the job they do, which is easier to remember than an alphabetical list.

Group 1: Simple aggregators

  • SUM adds up a numeric column. Total Sales = SUM ( Sales[Amount] )
  • AVERAGE works the same way for the mean. Avg Order = AVERAGE ( Sales[Amount] )
  • COUNTROWS counts the rows of a table. The COUNTROWS reference notes that it returns BLANK when the table has no rows, which keeps empty groups out of your visuals.
  • DISTINCTCOUNT counts unique values, such as unique customers. Watch the totals: an order that appears in two categories is counted once in the grand total, so the total is not the sum of the rows above it.

Group 2: Safe maths

  • DIVIDE divides two numbers and handles zero for you. Microsoft's DIVIDE best-practice article recommends it any time the bottom number might be zero or blank, and the plain / operator when you divide by a fixed number.
Profit Margin = DIVIDE ( [Total Profit], [Total Sales] )

Group 3: Row-by-row iterators

  • SUMX evaluates an expression for each row of a table, then adds the results. Use it when the value you need does not exist in a single column, such as quantity times price.
  • RELATED fetches a value from another table through an existing relationship. The RELATED reference explains that it needs a row context, so it works in a calculated column or inside an iterator like SUMX, but not on its own in a plain measure.
Revenue =
SUMX ( Sales, Sales[Qty] * RELATED ( 'Product'[Price] ) )

Group 4: Filter control

  • CALCULATE evaluates an expression after changing the filters. It gets its own section below.
  • FILTER returns a table that keeps only the rows meeting a condition. Use it when a simple condition inside CALCULATE is not enough.
  • REMOVEFILTERS (and its older relative ALL) clears filters, which is how you calculate a share of the total.

Group 5: Dates

  • CALENDAR or CALENDARAUTO builds a date table.
  • A time intelligence function such as PREVIOUSQUARTER or PARALLELPERIOD shifts the date filter to an earlier period.

Add VAR and RETURN to this list as soon as your formulas grow past two lines. They are keywords rather than functions, but they change how readable your work is.

DAX for beginners toolkit: 12 functions in 5 groups, from SUM and DIVIDE to CALCULATE and CALENDARAUTO
The twelve DAX functions to learn first, grouped by the job they do.

How Does CALCULATE Actually Change a Number?

Every value in a Power BI visual is calculated under a filter context. If a table visual shows categories down the side, then the Bikes row only "sees" bike sales. Slicers, page filters and relationships add more filters on top. The DAX basics quickstart describes two types of context:

  • Row context is the current row. You get it in a calculated column, or inside an iterator such as SUMX.
  • Filter context is the set of filters that decide which rows a measure can see. It comes from the report and from functions like CALCULATE, FILTER and ALL.

The CALCULATE function lets you edit that filter context inside a formula. The CALCULATE reference page gives the syntax as an expression followed by any number of filters. Here are the three patterns that cover most beginner needs.

Pattern 1: Add a filter

Online Sales =
CALCULATE ( [Total Sales], Sales[Channel] = "Online" )

This shows online sales on every row of your visual, whatever else is selected. If the visual already filters Channel, the new filter replaces the old one on that column. If you want both filters to apply together, wrap the condition in KEEPFILTERS.

Pattern 2: Remove a filter to get a share of total

Sales % of All Channels =
DIVIDE (
    [Total Sales],
    CALCULATE ( [Total Sales], REMOVEFILTERS ( Sales[Channel] ) )
)

The bottom half ignores the channel filter, so each row is divided by the total for all channels. Microsoft's own example of this pattern, built on the Adventure Works sample, shows the Internet channel at 26.74% and Reseller at 73.26% of total sales.

Pattern 3: Shift dates

Previous Quarter Sales =
CALCULATE ( [Total Sales], PREVIOUSQUARTER ( 'Date'[Date] ) )

This one depends on a proper date table, which is the next topic.

The reference page also lists a few rules for simple true-or-false filters inside CALCULATE. They can only reference columns from one table, they cannot reference a measure, and they cannot contain another CALCULATE. When you hit one of those limits, switch to a FILTER expression instead.

Context transition, in one paragraph

When you use CALCULATE inside a row context, such as in a calculated column, it turns the current row into a filter. Microsoft calls this context transition. It is why a measure placed inside a calculated column returns a value for that row instead of the grand total. You do not need to master it this week. Just remember the name, because it explains many "why is this number different?" moments later.

Why Do You Need a Date Table Before Time Intelligence?

Year-over-year growth, month-to-date and previous-quarter figures all rely on time intelligence functions, and those functions expect a correct date table. Microsoft's date table guidance lists the requirements:

  1. A column of date (or date/time) type.
  2. Unique values in that column, with no blanks.
  3. No missing dates in the range.
  4. Full years, though the year can be a financial year rather than January to December.

The quickest way to meet all four is a calculated table:

Date = CALENDARAUTO ( 6 )

The 6 tells Power BI your financial year ends in June, so the table runs from July to June. Leave the argument out for a December year-end. Then create a relationship from 'Date'[Date] to the date column in your sales table, and always use the date table's columns on your visuals and slicers.

The guidance also notes that Power BI's automatic date/time option is fine for quick exploration, but it does not give you one shared date table that filters several fact tables. For any report you plan to keep, build your own.

Write Cleaner Formulas With Variables

Variables are the single biggest upgrade to a beginner's DAX. Microsoft's article on using variables lists four benefits: better performance, readability, easier debugging, and less complexity. In its own example, the version with a variable ran in about half the query time, because the prior-year value was calculated once instead of twice.

Compare these two versions of year-over-year growth.

-- Without variables: the prior-year expression appears twice
Sales YoY % =
DIVIDE (
    [Total Sales] - CALCULATE ( [Total Sales], PARALLELPERIOD ( 'Date'[Date], -12, MONTH ) ),
    CALCULATE ( [Total Sales], PARALLELPERIOD ( 'Date'[Date], -12, MONTH ) )
)

-- With a variable: calculated once, read like a sentence
Sales YoY % =
VAR PriorYear =
    CALCULATE ( [Total Sales], PARALLELPERIOD ( 'Date'[Date], -12, MONTH ) )
RETURN
    DIVIDE ( [Total Sales] - PriorYear, PriorYear )

The debugging trick is my favourite part. If the growth figure looks wrong, change the last line to RETURN PriorYear for a moment. Now the measure shows just the prior-year number, and you can see which half of the formula is misbehaving.

Common Mistakes in DAX for Beginners

I see the same handful of errors in almost every new class. Each one has a quick fix.

1. Building calculated columns for everything

A column for profit, another for margin, another for "is this a big order". The file gets heavier and the totals often come out wrong, because a margin column summed across rows is not a margin. Make these measures instead.

2. Dividing with a slash

The first time a category has zero sales, the visual fills with errors. Use DIVIDE whenever the bottom number comes from your data.

RELATED needs a row to work on. In a measure, place it inside SUMX, FILTER or another iterator, as in the Revenue example above.

4. Expecting DISTINCTCOUNT totals to add up

They usually will not, and that is correct behaviour. The grand total counts unique values across everything, not the sum of each row.

5. Using the sales table's date column on visuals

Time intelligence then returns blanks or odd values. Put the date table's columns on your axis and slicers.

6. Trusting a number because the formula ran

Check a few values by hand against the source, or in DAX query view. It takes two minutes and catches most logic errors before your manager does.

7. Unreadable names and no formatting

Measures named m1 and formulas on a single long line are hard to fix later. Use plain names, one argument per line, and Shift+Alt+F in DAX query view to tidy things up.

A Short DAX Glossary

Every DAX for beginners course uses the same vocabulary, so keep these terms handy. They appear in documentation, forum answers and Power BI interview questions.

Term Plain meaning
Semantic model Your tables, relationships and measures together, the thing reports are built on
Filter context The filters that decide which rows a measure can see right now
Row context The current row, inside a calculated column or an iterator
Iterator A function that works row by row, such as SUMX
Context transition CALCULATE turning the current row into a filter
BLANK DAX's "no value"; visuals hide groups whose result is blank by default
Fully qualified name A column written with its table, such as Sales[Amount]

Can Copilot Write DAX for You?

Partly, and it is useful once you know enough to check its work. In any DAX for beginners plan, treat Copilot as a helper, not a replacement for understanding. Microsoft's page on using Copilot to write and explain DAX queries says it can write a query from a plain-language request, change an existing query, and explain a query or a DAX topic. In Power BI Desktop you open it with Ctrl+I in DAX query view, after enabling the preview feature in Options.

There are limits you should know before you plan around it:

  • It needs a workspace on a Fabric capacity, so a free or basic account may not have it.
  • It works from your model's metadata, such as table, column and measure names, so clear names give better results.
  • Microsoft notes that newly added DAX functions may be unknown to Copilot, and its explanations of them may be wrong.
  • The generated query is checked for syntax, not for correct business logic.

Warning: Do not let Copilot be your first teacher. If you cannot read the formula it produces, you cannot tell when it is wrong. Learn the twelve functions above first, then use Copilot to speed up the typing.

What About DAX User-Defined Functions?

You will see this feature mentioned in 2026 tutorials, so it is worth knowing what it is. Microsoft's user-defined functions overview says they are generally available in both Power BI Desktop and the online service from the June 2026 release. They let you write a piece of logic once, give it parameters, and reuse it in many measures.

DEFINE
    FUNCTION AddTax = ( amount : NUMERIC ) => amount * 1.18
EVALUATE
    { AddTax ( 100 ) }

The rate here is only an example, so use whatever your business actually needs. For a beginner, functions are a month-three topic. Learn measures and CALCULATE first. Come back to functions when you notice yourself copying the same logic into five different measures.

How Long Does It Take to Learn DAX?

There is no official figure, so here is a teacher's estimate rather than a statistic. DAX for beginners is less about memory and more about practice. Students who already know Excel formulas can usually write correct SUM, DIVIDE and CALCULATE measures after a few focused practice sessions. Filter context and time intelligence take longer, because they only make sense once you have seen numbers change in real visuals. Plan on weeks of steady use, not a single weekend course.

A practice routine that works well in my classes:

  1. Build one small model with a sales table, a product table and a date table made with CALENDARAUTO.
  2. Write Total Sales, Total Qty and Profit Margin as explicit measures.
  3. Add Revenue with SUMX and RELATED.
  4. Add Online Sales and Sales % of All Channels with CALCULATE.
  5. Add Sales YoY % using a variable.
  6. Open DAX query view and check two numbers by hand against your source data.

If you are deciding whether Power BI is the right next step at all, my comparison of Power BI vs Excel covers which to learn first, and the data science roadmap shows where DAX sits in a wider analytics career. Power BI and DAX are part of what I teach in Abbottabad (PSTA among them) and in live online classes. The teaching page has the details.

What to Do This Week

Open Power BI Desktop, load any sales spreadsheet you have, and write three measures: Total Sales, Profit Margin with DIVIDE, and Sales % of All Channels with CALCULATE and REMOVEFILTERS. Put them in one table visual next to a category column and click through a slicer. Watching the same three formulas change under different filters will teach you more about DAX than another hour of video. If you get stuck on a real business report, you can get in touch and describe what you are trying to build.

Frequently asked questions

What is DAX in Power BI?

DAX, short for Data Analysis Expressions, is the formula language of Power BI. You use it to create measures, calculated columns and calculated tables from data already in your model. Unlike Excel formulas, DAX works on whole columns and tables, and its results change with the filters applied in a report.

Is DAX hard to learn for beginners?

DAX syntax is not hard if you know Excel formulas, because many functions look familiar. The difficult part is filter context: the same measure returns different values depending on slicers and visuals. Start with SUM, DIVIDE and CALCULATE in a small model, and the idea becomes clear after some hands-on practice.

What is the difference between a measure and a calculated column?

A measure returns one value for the current filters and is calculated when a visual asks for it, so it is never stored. A calculated column returns one value per row, is calculated at data refresh, and adds to the size of an Import model. Use measures for totals and ratios.

Which DAX functions should I learn first?

Start with SUM, AVERAGE, COUNTROWS and DISTINCTCOUNT for basic totals, DIVIDE for safe division, SUMX and RELATED for row-by-row maths, then CALCULATE, FILTER and REMOVEFILTERS for filter control. Add CALENDARAUTO and one time intelligence function such as PREVIOUSQUARTER once you have a date table.

Why does my DAX measure show the same number in every row?

Usually a filter is being removed or replaced. If you used ALL or REMOVEFILTERS on the column shown in the visual, every row sees the full total. It can also happen when the visual uses a column that has no relationship to the table your measure summarises. Check your model relationships first.

Do I need a date table for DAX time intelligence?

Yes. Time intelligence functions need a date table with one row per date, unique values, no blanks, no missing dates and full years. You can create one quickly with CALENDARAUTO as a calculated table, then relate it to the date column in your sales table and use its columns on visuals.

Can Copilot write DAX formulas for me?

Copilot can write, change and explain DAX queries in DAX query view, but it needs a workspace on a Fabric capacity. It checks syntax, not business logic, and Microsoft warns it may not know newly added functions. Learn the core functions first so you can tell when its output is wrong.

Sources

  1. Learn DAX basics in Power BI Desktop learn.microsoft.com
  2. Understand DAX calculation types learn.microsoft.com
  3. CALCULATE function (DAX) learn.microsoft.com
  4. DIVIDE function vs divide operator learn.microsoft.com
  5. Use variables to improve your DAX formulas learn.microsoft.com
  6. Date tables in Power BI learn.microsoft.com
  7. Work with DAX query view learn.microsoft.com
  8. Use Copilot to write and explain DAX queries learn.microsoft.com
Written by Umar Qureshi

Computer science teacher, full-stack developer and SaaS builder from Abbottabad, Pakistan. Builder of OnePlace and the PSTA platform.

About Sir Umar Qureshi →

Need a website, a platform or training?

Work directly with Sir Umar Qureshi — developer of OnePlace and the PSTA platform.

Let’s talk →