DAX Basics In Power BI: Measures You Will Actually Use
A first set of Power BI DAX measures for work: totals, counts, averages and a careful year-to-date, with checks you can compare against Excel.

In Power BI, a DAX measure is a calculation that sits in the data model and responds to the filters on the page, such as year, branch or product. Start with a few explicit measures — Total Sales, Transaction Count, and Average Sale — written with functions such as SUM, COUNTROWS and DIVIDE, rather than dropping raw columns into a visual and hoping the default aggregation is right.
- Use a measure for calculations you want to reuse and filter, and a calculated column only when you need a value stored on every row.
- Write totals with SUM or COUNTROWS, and write ratios with DIVIDE so you do not divide by zero.
- Give every measure a clear name and a number format before you put it on the page.
- DAX is easier once the model is tidy: one fact table, dimension tables, and relationships that you can explain.
Many people open Power BI after years in Excel and look for a cell to type a formula. In Power BI, the most useful calculations live in the model as measures. They look a little like Excel formulas, but they are evaluated in the context of whatever filters the reader has applied. That is the idea you need first, before a long catalogue of functions.
This article stays with a handful of measures you will actually use on a first dashboard. For layout and visual choices, see Power BI dashboard design. If you are still deciding whether the report belongs in Excel, read Power BI vs Excel.
01Measures Versus Calculated Columns
A calculated column is computed row by row and stored in the table, like an extra Excel column. It is useful for a fixed label, such as grouping product names into a small set of categories, when you cannot do that earlier in Power Query.
A measure is calculated at query time, in the filters that apply to the visual. Total sales for the year, for the selected branch, or for a single product are the same measure, evaluated in different contexts. If you create a calculated column for “total sales”, you usually already have the wrong tool: totals should change when the reader clicks a slicer.
Rule of thumb: if the number should respond to filters on the page, write a measure. If you need a value on each row before any filter is applied, consider a column, or, better, add it in Power Query if you can.
02Get The Model Ready First
DAX is hard to trust in a single flat spreadsheet dumped into Power BI, with mixed totals and merged headings. Aim for:
- a fact table of events or transactions (sales, claims, tickets), with numeric columns and keys;
- dimension tables for Date, Product, Branch or Department;
- relationships from the fact table to those dimensions, that you can describe in one sentence.
Give columns clear names, such as AmountRM and OrderDate, so the measures read like English. Clean the data in Power Query before you write DAX. A measure cannot repair a typo in a branch name or a text column that should be a number.
03Three Measures To Write First
In Power BI Desktop, right-click the fact table, choose New measure, and enter the formulas below, adjusting table and column names to match your model.
Total Sales
Total Sales = SUM ( Sales[AmountRM] )
An explicit measure is better than dragging AmountRM into a visual and accepting “Sum of AmountRM”. You can format it once, reuse it in other measures, and keep the same name on every page.
Transaction Count
Transaction Count = COUNTROWS ( Sales )
COUNTROWS counts the rows that remain after filters. That is usually what you want for “how many invoices” or “how many claims”. Avoid counting a column that might be blank unless you mean to ignore blanks.
Average Sale
Average Sale = DIVIDE ( [Total Sales], [Transaction Count] )
DIVIDE is safer than the / operator, because you can control what happens when the denominator is zero (the default is a blank, which is usually better than Infinity on a card). Notice that this measure is built from the two measures above, not by repeating SUM and COUNTROWS. That way, a later change to Total Sales flows through.
04Add Year-To-Date Once The Basics Work
If you have a proper Date table marked as a date table, and a relationship from Sales[OrderDate] to Date[Date], you can write:
Sales YTD = TOTALYTD ( [Total Sales], 'Date'[Date] )
Do not start here on day one. If this measure looks wrong, the cause is often the Date table — missing dates, the wrong relationship, or the fact table still holding text dates — not the DAX syntax. Check a single year and a single branch against Excel before you put Sales YTD on the homepage of a dashboard.
05Check A Measure The Way You Would Check Excel
Pick two filters you can verify by hand, for example January and one branch. Put Total Sales, Transaction Count and Average Sale on a card or a small table, then compare them with a PivotTable or SUMIFS on the same extract in Excel. If they do not match, look at:
- filters that are still applied from another page or from the filter pane;
- blank or rejected rows that Power Query dropped;
- a relationship that is inactive or pointing the wrong way;
- a visual that is using the raw column instead of your measure.
This check takes a few minutes and is the difference between a dashboard people trust and one they ignore. The same discipline sits behind the design rules in our dashboard design guide.
06Naming, Format And A Small Tidy Habit
Name measures in plain language: Total Sales, not SumAmt2. Set the format (currency, whole number, or two decimal places) on the measure itself, so every visual inherits it. Keep measures in one display folder, or in a dedicated measures table, so the field list stays readable as the model grows.
Resist writing a new measure for every visual. If two cards show the same idea with a slightly different name, readers will wonder whether the numbers are meant to differ. Reuse the measure and let the visual’s filters do the work.
07Frequently Asked Questions
Do I Need to Learn All of DAX to Build a Dashboard?
No. A first useful report can run on a small set of measures: sums, counts, a ratio with DIVIDE, and perhaps a year-to-date once the Date table is solid. Broader DAX comes later, when the questions get harder.
Why Does My Measure Ignore the Slicer?
Often the visual is still using a default aggregation on a column, or the slicer is on a field that is not related to the fact table. Check that the visual uses your measure, and that a relationship exists between the slicer table and the fact table.
Is DAX the Same as an Excel Formula?
Some function names look familiar, but the evaluation is different. A measure is calculated in filter context, not in a single cell. That is why the same measure can serve a card, a chart and a table.
Where Should I Clean Data — DAX or Power Query?
Clean and shape data in Power Query where you can. Use DAX for calculations that must respond to the reader’s filters. Do not use DAX to fix typo-ridden branch names or to parse messy dates if you can correct them earlier.
If you want guided practice building a model, writing a first set of measures and laying out a report, you can view the Power BI Dashboards course and register your interest. Other short courses are listed on our courses page.




