DAX in Power BI: What It Is and How to Start Using It

By Vivek Dhumal • 2026-06-20 • 10 min read
DAX in Power BI: What It Is and How to Start Using It
Key Takeaways
  • DAX (Data Analysis Expressions) is the formula language used inside Power BI to perform calculations on your data — similar in spirit to Excel formulas, but built to work across entire tables and relationships.
  • Power BI DAX is used to create three main assets: calculated columns, measures, and calculated tables.
  • The single most important DAX concept to master early is context — evaluation results shift dynamically on slicers, row elements, and report filters.
  • CALCULATE, SUMX, SWITCH, SELECTEDVALUE, and DATEADD are core functions you will reach for constantly.

What Is DAX in Power BI?

DAX (Data Analysis Expressions) is the formula language built into Power BI. It's also used in Excel's Power Pivot and in Analysis Services. DAX lets you perform calculations on data stored in tables.

That's the short answer to "what is DAX" or "DAX meaning." DAX isn't a separate program. You don't install it. It's the calculation engine sitting underneath Power BI itself. Microsoft built it for business intelligence work. That means it's designed to aggregate thousands of rows, apply filters dynamically, and calculate values that depend on how a report is currently being viewed.

If you've used Excel formulas before, DAX will feel familiar in places. It uses functions like SUM, AVERAGE, and IF, written in a similar style. But there's a key difference. Excel formulas typically calculate one cell at a time. DAX formulas calculate across entire columns and tables. They often factor in relationships between multiple tables at once.

Think of it this way: In Excel, a formula usually says "do this calculation, in this cell, using these other cells." In DAX, a formula says "do this calculation, across this entire table, taking into account whatever filters are currently applied." That second part is the filter context. Filters get applied automatically based on what someone's looking at in a report. This is the piece that trips up almost every beginner at first. It's worth slowing down on.

DAX vs. Power Query: Two Different Jobs

New Power BI users often confuse DAX with Power Query (also called the M language). They can look like they do similar things. But they solve two different problems.

Power Query gets and shapes your data before it loads into your model. This includes connecting to a source, removing unnecessary columns, fixing data types, merging tables, or splitting a column into two. It runs before your data lands in the model.

DAX calculates answers from data that's already loaded into your model. It runs after Power Query has done its job. DAX is what powers your measures, calculated columns, and calculated tables.

Rule of Thumb

Power Query gets your data ready. DAX calculates answers from data that's already ready. Does a column have the wrong data type? Is the text messy? Do you need to combine two source files? That's a Power Query problem. Do you need a total, a percentage, or a year-over-year comparison? That's a DAX problem.

The Three Things DAX Can Build

DAX isn't one single type of formula. It builds three distinct things inside Power BI. Knowing the difference between them early will save you a lot of confusion later.

Calculated Columns

A calculated column is a new column added to a table. A DAX formula computes every row's value. The result is physically stored in your data model.

Picture a Sales table with columns for Quantity and Unit Price. You could add a calculated column called Line Total that multiplies those two columns together, row by row. Once created, that column behaves just like any other column in your table. You can use it in visuals, filter by it, or group by it.

Here's the trade-off: Because the result is stored for every row, calculated columns take up space in your data model. For small tables, this is a non-issue. For very large tables, it is worth knowing it expands physical RAM consumption.

Measures

A measure is a DAX formula that calculates a result on the fly, based on whatever's currently visible in a report. It doesn't store a value for every row.

This is the one you'll use the most, by far. A measure like Total Sales doesn't store one fixed number. It recalculates every time the context around it changes. Drop it into a table visual broken down by region, and it recalculates per region. Add a date slicer, and it recalculates per selected date range. Nothing is pre-stored. Everything is computed at the moment you view it.

Calculated Tables

A calculated table is an entirely new table generated from a DAX formula, rather than loaded directly from a data source.

These are used for specific, targeted jobs: building a standalone date table, creating a summary table for a specific analysis, or generating a list of distinct values pulled from another table. You can come back to computed tables once you have a specific architectural need.

The Concept That Actually Matters Most: Context

There's one idea worth understanding deeply before anything else in DAX: context is the set of filters currently applied to a calculation. It's what makes the same DAX formula return different numbers in different parts of the same report.

Two types of context show up constantly in DAX work:

  • Row context is what's active when a formula is being calculated one row at a time. This matters most for calculated columns, and for functions that loop through tables row by row.
  • Filter context is what's active based on everything surrounding a visual: slicers, filters, rows and columns in a table or matrix, even other measures referencing this one. This is the reason a Total Sales measure shows one number on an unfiltered card visual, and a different number when filtered by region.

This is genuinely the concept that separates people who copy-paste formulas from database developers who write and troubleshoot their own. Once context clicks, DAX becomes incredibly intuitive.

CALCULATE: The Function Worth Learning First

Most DAX learning paths eventually arrive at one function that does more conceptual heavy lifting than any other: CALCULATE.

CALCULATE evaluates an expression while modifying the filter context around it. It's how you tell a measure to ignore, add, or override certain filters.

Here's a simple example. Imagine you have a Total Sales measure. You want a second measure called Sales Last Year that always shows last year's number, no matter what date filter is currently applied on the report. You can't just write a second SUM formula. You need to tell DAX to calculate Total Sales, but under a different filter context, shifted back one year. That's exactly what CALCULATE does.

Sales Last Year = CALCULATE(
    [Total Sales],
    SAMEPERIODLASTYEAR('Calendar'[Date])
)

You don't need to fully understand every piece of that formula yet. Just notice the shape of it: take an existing measure, and recalculate it under a modified set of filters. Once you're comfortable with that pattern, intermediate DAX work becomes fully accessible!

Common DAX Functions You'll Run Into

You don't need to memorize a function list to get started. But it helps to know the categories you'll capture in real-world dashboard developments:

Category What it does Example functions
Aggregation Summarizes a column into a single number SUM, AVERAGE, COUNT, MIN, MAX
Filter Modifies or returns the current filter context CALCULATE, FILTER, ALL
Time intelligence Handles date-based comparisons SAMEPERIODLASTYEAR, DATEADD, TOTALYTD
Iterator (X-functions) Loops through a table row by row SUMX, AVERAGEX, RANKX
Relationship Pulls values across related tables RELATED, RELATEDTABLE, LOOKUPVALUE
Logical Conditional logic IF, SWITCH, AND, OR
Table/value Returns unique values or specific values from context DISTINCT, SELECTEDVALUE, VALUES

A handful of these are worth a closer look:

SWITCH is a cleaner way to write multiple nested IF conditions inside your formulas without stacking brackets recursively:

Sales Tier = SWITCH(
  TRUE(),
  [Total Sales] > 100000, "High",
  [Total Sales] > 50000, "Medium",
  "Low"
)

SELECTEDVALUE returns a single value when exactly one value is filtered in a slicer. It is perfect for dynamic cards and table header labels!

LOOKUPVALUE acts like Excel's VLOOKUP. It fetches a value from a column without needing a formal relationship model set up, though a formal star-schema relations design is preferred.

DATEADD shifts a date column forward or backward by a specified interval: days, months, quarters, or years. It's the ultimate time intelligence companion.

Writing Your First Measure: A Walkthrough

Let's put this together with an actual measure, step by step.

Step 1: Open the modeling view and find "New Measure."
In Power BI Desktop, select the table where you want your measure to live. Then click New Measure from the ribbon.

Power BI New Measure

Figure 1: Selecting data tables from the Power BI Desktop field list to invoke the New Measure button from the ribbon.

Step 2: Write the formula in the formula bar.
Let's say you want total revenue. Quantity lives in your Sales table, and Unit Price lives in a related Products table:

Total Revenue = SUMX(Sales, Sales[Quantity] * RELATED(Products[Unit Price]))

Step 3: Understand what's happening.
SUMX walks through the Sales table one row at a time. For each row, it multiplies that row's Quantity by the matching Unit Price mapped via RELATED. Once it's gone through every row, it adds all those results together into one total.

Step 4: Verify the visual outcome.
Drag the measure onto a card visual. If it displays clean decimals instead of Infinity or Blank errors, your star-schema relations are healthy!

DAX Queries vs. DAX Formulas

So far, we've focused on DAX formulas — the expressions behind a measure. A DAX query is different. A DAX query requests and returns an entire table on demand. It is most often run in diagnostic software like DAX Studio, or using Power BI's own "Run DAX query" option.

EVALUATE
SUMMARIZE(Sales, Sales[Region], "Total", SUM(Sales[Revenue]))

Formatting DAX for Readability

As your complex calculations grow, indentation becomes vital for peer handovers. Compare these profiles: the calculation is identical, but the second layout makes filter modifications stand out immediately:

Sales Last Year=CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Calendar'[Date]))
Sales Last Year = 
CALCULATE(
  [Total Sales],
  SAMEPERIODLASTYEAR('Calendar'[Date])
)

In Practice: A Real Year-over-Year Example

Here is a real layout designed to find the variance between this year's income and last year's performance using clean logic blocks:

1. Base Aggregate Measure:

Total Revenue = SUM(Sales[Revenue])

2. Context Modification:

Revenue Last Year = CALCULATE(
  [Total Revenue],
  SAMEPERIODLASTYEAR('Calendar'[Date])
)

3. Safe Ratio Delta Calculation:

YoY Change % = 
DIVIDE(
  [Total Revenue] - [Revenue Last Year],
  [Revenue Last Year]
)

Notice the use of DIVIDE over the standard division operator (/). This automatically intercepts division-by-zero scenarios and prevents ugly NaN/Infinity printouts in your report visuals.

Common Beginner Mistakes to Avoid

  • Confusing Column vs. Measure: If a calculation needs to react dynamically when slicing, it must be a Measure. If it must establish static groupings, text flags, rows, or filter slicer fields, use a Calculated Column.
  • Table relationship traps: Trying to multiply columns from two separate tables without using RELATED or iterator helper functions.
  • Ignoring relationships: Composing DAX without checking your Model Relations tab first. The best code won't save a broken relationship geometry.

Tools and AI Ecosystems

Developers who progress past standard reporting tools frequently download DAX Studio or Tabular Editor to manage robust metadata volumes. In addition, AI companion assets like Microsoft Copilot and Claude are excellent for verifying your formula syntax or breaking down unknown time-intelligence logic in plain language.

Recommended Next Guides & Deep Dives

Continue expanding your Power BI and Fabric architecture knowledge with these closely connected tutorials:

Step-by-Step Implementation Sandbox

1. Create a Dedicated Measure Table

In Power BI Desktop, click 'Enter Data'. Name the table '_Measures' and hit Load. This lets you store all dynamic measures in one clean sequential folder.

2. Establish Model Relationships first

Always go to Model View and verify your Fact tables are linked to Dimension tables via 1-to-many relationships (using single filter direction) before composing DAX.

Frequently Asked Questions

Is DAX hard to learn if I am not good at math?

No! DAX is closer to learning a structured way of asking questions about your data than solving mathematical equations. It is all about logic and matching evaluation context.

What's the difference between DAX and Power Query / M language?

Power Query gets your data ready (extract, transform, load). DAX calculates answers from data that's already loaded into your database model.

Why is DIVIDE preferred over raw slash (/)?

DIVIDE safely catches division by zero errors and outputs blanks or a chosen fallback, preserving clean visual boards without NaN glitches.

Vivek Dhumal

Vivek Dhumal

BI Consultant

BI Consultant & Power BI Developer

Vivek Dhumal is a dedicated BI Consultant and Data Analyst specializing in Power BI development, DAX calculations, SQL data modeling, ETL automation, and scalable business intelligence solutions.