How To Write Your First DAX Measure
Level: intermediate · ~16 min read · Intent: informational
Audience: data analysts, finance teams, operations teams
Prerequisites
- basic spreadsheet literacy
- introductory Power BI concepts
Key takeaways
- Your first DAX measure should be simple, explicit, and tied to one clear business question such as total revenue or total orders.
- The most important thing to understand about a DAX measure is that it returns a single scalar result that changes depending on report context, such as filters, slicers, and the fields used in a visual.
FAQ
- What is a DAX measure?
- A DAX measure is a formula used in Power BI to calculate a summarized result, such as total revenue or average margin, and it changes depending on the current report context.
- What should my first DAX measure be?
- Your first DAX measure should usually be a simple business metric like total revenue, total quantity, or order count so you can focus on understanding how measures behave in visuals.
- What is the difference between an implicit and explicit measure?
- An implicit measure is created automatically when Power BI summarizes a field in a visual, while an explicit measure is one you create yourself with a DAX formula using New measure.
- Why does my DAX measure change in different visuals?
- A DAX measure changes in different visuals because it is evaluated in the current filter context, which is affected by slicers, filters, relationships, and the fields placed in the visual.
Writing your first DAX measure is one of the most important steps in learning Power BI because it marks the point where you stop relying only on automatic summarization and start defining your own analytical logic. Before that point, Power BI can still build charts and totals for you. But once you start writing measures, the report becomes much more flexible, much more reusable, and much more aligned with real business questions.
That is why this skill matters so much.
A lot of beginners assume that writing a first DAX measure means jumping into advanced formulas immediately. It does not. In fact, the best first measure is usually extremely simple. What matters most is not complexity. What matters is learning the pattern:
- pick a clear business question
- create an explicit measure
- write a simple formula
- test it in visuals
- observe how it changes with context
This guide explains how to write your first DAX measure in Power BI, what a measure actually is, where to create it, how to test it, what beginner-friendly examples to use, and which mistakes to avoid as you learn.
Overview
A DAX measure is a formula that returns a summarized result in a Power BI model.
That result is usually something like:
- total revenue
- total quantity
- average margin
- distinct customer count
- orders this month
- year-to-date sales
Microsoft’s DAX glossary defines a measure as a calculation that achieves summarization and states that a measure formula must return a scalar value. It also distinguishes between implicit and explicit measures. citeturn174996search19
That means the key job of a measure is to answer one business question with one summarized result.
A useful beginner way to think about it is this:
A measure returns an answer. A calculated column creates a field.
That is why your first DAX measure should be something simple and useful.
What your first DAX measure should look like
Your first DAX measure should usually be:
- easy to understand
- tied to one business question
- based on one clear numeric field
- useful in multiple visuals
- simple enough to test easily
Good first examples include:
- Total Revenue
- Total Quantity
- Total Cost
- Total Orders
- Average Price
These are excellent first measures because they help you focus on how measures behave, not just how syntax looks.
Why starting simple is the best move
A lot of beginners make learning harder by trying to start with:
- time intelligence
- complex CALCULATE logic
- percentages of total
- ranking
- advanced filters
Those things matter later.
But your first DAX measure should teach you the foundation:
- where measures live
- how to create one
- how the syntax works
- how the result changes across visuals
- how filter context affects the answer
That is why simple is better at the start.
Implicit versus explicit measures
One important beginner idea is the difference between implicit and explicit measures.
Microsoft’s Power BI documentation explains that Power BI can automatically summarize fields in visuals, but you can also create your own measures with DAX using New measure. Microsoft describes these user-created formulas as explicit measures. citeturn174996search0turn174996search2turn174996search5
Implicit measures
An implicit measure is created automatically when Power BI aggregates a field in a visual.
For example:
- dragging a Revenue column into a chart may automatically create a sum of revenue for that visual
This is useful, but limited.
Explicit measures
An explicit measure is a DAX formula you create yourself.
Examples:
Total Revenue = SUM(Sales[Revenue])Total Quantity = SUM(Sales[Quantity])
Explicit measures are better because:
- they can be reused in many visuals
- they are clearly named
- they are easier to manage
- they support richer logic later
- they are the real foundation of strong Power BI modeling
That is why writing your first explicit measure matters so much.
Where to create your first measure
In Power BI Desktop, a common way to create your first measure is:
- select the table where you want the measure to live
- go to Modeling
- choose New measure
- type the DAX formula in the formula bar
Microsoft’s Power BI documentation and tutorials describe using Modeling > New measure to create an explicit measure in Power BI Desktop. citeturn174996search0turn174996search2
This creates a measure with a calculator icon in the Fields pane.
That measure can then be reused across:
- tables
- charts
- cards
- matrices
- KPI visuals
- tooltips
This is one reason explicit measures are so valuable.
A simple first example: Total Revenue
A very strong first measure is:
Total Revenue = SUM(Sales[Revenue])
This works well because:
- the business question is obvious
- the formula is easy to read
- the result is easy to test
- the measure can be used almost everywhere in a report
If your model does not have a Revenue column, use a similar one such as:
- Quantity
- Cost
- Amount
- SalesAmount
- Units
The exact field matters less than the pattern.
The pattern is:
- choose one numeric column
- use a direct aggregation
- create a named explicit measure
That is the cleanest starting point.
Why your first measure should use SUM or another simple aggregation
When you write your first measure, it is best to use a function like:
- SUM
- COUNTROWS
- AVERAGE
- DISTINCTCOUNT
These functions help you learn the measure structure without introducing too much complexity.
Examples:
Total Quantity = SUM(Sales[Quantity])Order Count = COUNTROWS(Sales)Average Price = AVERAGE(Sales[UnitPrice])Customer Count = DISTINCTCOUNT(Sales[CustomerID])
These are excellent beginner measures because they teach the real pattern of DAX measures:
- name
- equals sign
- formula
- model usage
- testing in visuals
How to name your first measure well
Good naming makes DAX much easier to learn.
A useful beginner habit is to give measures names that reflect the business question clearly.
Good examples:
- Total Revenue
- Total Quantity
- Order Count
- Average Price
- Gross Margin %
Weak examples:
- Measure1
- Test
- New Measure
- ValueCalc
Clear names matter because Power BI models grow quickly. A good measure name makes the report easier to read, easier to maintain, and easier to reuse later.
What a measure returns
This is one of the most important beginner ideas.
A measure returns one scalar result in the current context.
Microsoft’s DAX glossary states that a measure formula must return a scalar value. citeturn174996search19
That means a measure returns:
- one number
- one date
- one text value, in some patterns
- one Boolean result, in some patterns
But usually, for beginner reporting work, it returns one summarized number.
Examples:
- 1,240,000
- 387
- 42.7%
- 18,954
This is why measures are different from columns. A column stores many row values. A measure returns one summarized answer in the current report context.
Why the same measure changes in different visuals
A lot of beginners are surprised when one measure shows different numbers in different visuals.
That is normal.
Measures are evaluated in the current filter context.
That context can come from:
- slicers
- page filters
- report filters
- chart categories
- relationships
- drill-down selections
For example, if you create:
Total Revenue = SUM(Sales[Revenue])
that same measure can show:
- total revenue for all data in a card
- revenue by region in a bar chart
- revenue by month in a line chart
- revenue for one selected year under a slicer
The formula stayed the same. The context changed.
This is one of the most important things your first measure teaches you.
How to test your first measure
Once you create your measure, test it in several visuals.
A very practical pattern is:
1. Put it in a card
This shows the total answer in the current page context.
2. Put it in a table
Add one or two dimensions, such as:
- Region
- Product Category
- Month
Now you can see how the measure behaves by category.
3. Put it in a chart
Use a bar chart or line chart to see how it changes over categories or over time.
This is one of the best beginner exercises because it makes filter context visible immediately.
A strong beginner workflow
If you are writing your first DAX measure, this is a strong process.
Step 1: Choose one business question
Examples:
- What is total revenue?
- How many orders do we have?
- What is average unit price?
Pick just one.
Step 2: Choose the correct base field
Use one clean numeric or countable field from the model.
Step 3: Create a new explicit measure
Use Modeling > New measure.
Step 4: Write a simple formula
Examples:
Total Revenue = SUM(Sales[Revenue])Order Count = COUNTROWS(Sales)
Step 5: Test it in multiple visuals
Use:
- card
- table
- chart
This helps you understand context.
Step 6: Rename and organize it properly
Keep the measure name clean and business-friendly.
That is already a complete beginner DAX workflow.
Common mistakes when writing the first measure
Mistake 1: Starting with something too advanced
Do not begin with:
- nested CALCULATE logic
- time intelligence
- ranking
- complicated IF chains
Start with a simple aggregation.
Mistake 2: Referring directly to a column without aggregation in a measure
A measure usually needs to return one summarized answer. If you point at a whole column directly, you may trigger the common DAX error: “A single value for column ... cannot be determined.”
That is one reason SUM, AVERAGE, and COUNTROWS are such good beginner tools.
Mistake 3: Creating a calculated column instead of a measure
If the goal is a report answer like total revenue or order count, a measure is usually the right choice.
Mistake 4: Not testing the measure in visuals
A measure is not really understood until you see how it behaves across:
- cards
- tables
- charts
- slicers
Mistake 5: Using vague names
Good measure naming helps a lot as your model grows.
What to learn after your first measure
Once you are comfortable writing one simple measure, the next useful steps are:
1. Write a few more basic measures
Examples:
- Total Cost
- Customer Count
- Average Price
2. Learn measures versus calculated columns
This is one of the most useful DAX design decisions.
3. Learn filter context
Understand why the same measure changes across visuals.
4. Learn CALCULATE
This is one of the most important next steps after basic measures.
5. Learn time intelligence later
Only after the basics feel stable.
This order makes DAX much easier to learn well.
Why explicit measures matter in real Power BI work
Explicit measures matter because they make models:
- cleaner
- more reusable
- easier to document
- easier to maintain
- easier to extend later
Microsoft’s Power BI learning material and product guidance distinguish implicit from explicit measures and emphasize creating your own measures with DAX for more complex and reusable calculations. citeturn174996search2turn174996search9turn174996search19
This matters because strong Power BI reports usually depend on:
- named measures
- clear business logic
- reusable metrics
- less dependence on ad hoc auto-summarization
That is why learning to write your first measure is such an important milestone.
FAQ
What is a DAX measure?
A DAX measure is a formula used in Power BI to calculate a summarized result, such as total revenue or average margin, and it changes depending on the current report context.
What should my first DAX measure be?
Your first DAX measure should usually be a simple business metric like total revenue, total quantity, or order count so you can focus on understanding how measures behave in visuals.
What is the difference between an implicit and explicit measure?
An implicit measure is created automatically when Power BI summarizes a field in a visual, while an explicit measure is one you create yourself with a DAX formula using New measure.
Why does my DAX measure change in different visuals?
A DAX measure changes in different visuals because it is evaluated in the current filter context, which is affected by slicers, filters, relationships, and the fields placed in the visual.
Final thoughts
Writing your first DAX measure is important because it is the point where you begin defining your own analytical logic instead of relying only on Power BI’s automatic behavior.
That is the real milestone.
The best first measure is not the most complex one. It is the one that teaches you the core pattern:
- create an explicit measure
- answer one business question
- use a simple aggregation
- test it in visuals
- observe how context changes the result
Once that pattern becomes familiar, DAX stops feeling like a wall of formulas and starts feeling like a practical reporting tool.
That is why the first measure matters so much. It is the beginning of understanding how Power BI actually thinks.