This summary is produced by the author, and not by AI.
Write calculations to group and analyze your data.
In this series, we provide tips for how to effectively build a semantic model (formerly a dataset) in Power BI or Analysis Services. In the previous article, we described how you validate model relationships, which are links between tables and the foundation of your business logic. Once you’ve created and validated your relationships, you should now have the foundation of your model ready so that you can proceed with the next step.
In this article, we describe this next step in making a semantic model, where you create calculations by writing DAX. You reference the tables, columns, and relationships you’ve added to the model in previous steps to define these calculations for reports. These calculations are what you use in report visuals or Excel pivot tables to analyze your data.
The purpose of this article is to give an overview of the basics–when you write DAX, and how you can do this in Power BI Desktop, Tabular Editor or Microsoft Fabric.
There are many equally valid ways to build a semantic model that fits your data needs. This series presents one approach, sharing tips and good practices from our experience. See below for the other, published articles in this series:
Data Analysis Expressions (DAX) is a functional and query programming language used in Power BI and other applications to analyze data. You write DAX expressions to define custom calculations or logic inside a model, and Power BI uses DAX queries to query the model from your report. DAX is how your visuals communicate with the semantic model to retrieve the data you need. The DAX expressions you write are like instructions that tell the model which tables and columns to use, and what to do with them. When you write DAX, you reference tables, relationships, columns, and other calculations (measures), then use functions like SUM or AVERAGE to aggregate or filter data.
To search for a DAX function or if you want more information about how it works, use dax.guide. When you write DAX in Tabular Editor 3, tooltips for functions will also explain what they do, their syntax, and link to the relevant dax.guide documentation page(s).
Figure 1: In Tabular Editor, you can get information about functions as you write them, including function syntax, explanations, and links to documentation.
The following image shows the difference between a DAX expression and a DAX query. DAX queries are generated by Power BI to get data from a model, but advanced users might want to write DAX queries themselves for testing or validation purposes, or to automate certain tasks. We talk more about this in later articles of this series.
The previous example can be understood as follows:
[Selling Margin (Value)]. It computes the sum of each row in the Invoices table, subtracting the value in the 'Invoices'[Net Invoice Cost] column from the value in the 'Invoices'[Net Invoice Value] column. Since the selling margin should only be calculated for invoice documents (and not other document types), a CALCULATE function filters the result to only invoices by using the related 'Invoice Document Type'[Invoice Type] column, which is a dimension table related to the Invoices fact table. Measures are typically used in DAX queries, where they may produce different results based on which filters are currently active.[Invoice Lines] (which thus only exists in the query), and uses it in the query (after EVALUATE) to compute the lines by month. A developer might periodically run a query like this to validate the model or underlying data. A query can also refer to measures defined inside the model.DAX occurs throughout a Power BI solution. The following image depicts a basic overview of the different places where you might write DAX in Power BI models and reports.
DAX exists throughout Power BI
DAX is a simple language in its syntax and structure, but it’s well-known that DAX isn't easy to learn. DAX resembles the simplicity of the Excel formula language at first glance, but this can be deceiving, as it’s more sophisticated to be able to address more scenarios than you’d encounter in Excel. Since DAX relies on a data model instead of cell positions on a worksheet, authors have to “think using the data model”, which is challenging for a novice to data modelling. The following are typical concepts that an experienced developer takes for granted, but a new developer must learn through experience:
An additional reason why DAX is challenging is because it operates differently from other programming languages. Some conventions in DAX are unique to DAX; it “thinks” in a unique way. This means that some developers with experience in other languages can apply conventions or practices that don’t work—or worse—they work but produce a suboptimal result.
The following are additional examples of specific conventions or rules in DAX that are challenging to understand when you first start to write the DAX language.
CALCULATE argument (like 'Date'[Month] = "January"). This filter context overrides other filters on the referenced column, unless the KEEPFILTERS CALCULATE modifier is used.'Invoices'[Sales] - 'Invoices'[Cost] in the Invoices table in a calculated column, it uses a row context for the Invoices table to get a result for each row.SUMX( 'Invoices', 'Invoices'[Sales] - 'Invoices'[Cost] ) in a DAX measure, it also uses the row context for the Invoices tableYou can see intermediate evaluation results of your DAX expressions in Tabular Editor by using the DAX debugger. This is helpful both to learn and to troubleshoot DAX code. We explain the debugger in a later article.
When you write DAX in Tabular Editor 3, it will point out these special conventions for you. For example, a tooltip will tell you about calculate arguments, active contexts, and when context transition is happening. That way, you can focus on writing the DAX. You can toggle this tooltip to pop up wherever your cursor is by pressing Ctrl + Shift + Spacebar.
Concepts like the above might sound intimidating, but don’t fear DAX; it’s very elegant and powerful. Despite what many LinkedIn influencers will tell you, you can benefit and get value from something without mastering it. For instance, in rare cases, you might not even need DAX in your semantic model.
You can create a model that has no DAX and use this data model to make a report. For instance, if you will only use the report to show data with descriptive attributes or unaggregated data, there’s no need to write any DAX. An example of this is a report for a product catalogue, or one designed to explore order documents by line item; raw transactions that aren’t summed together. However, reports like this are uncommon, since the benefit of Power BI reporting (and the VertiPaq engine that it uses) is to efficiently aggregate and visualize large, complex data.
You can also use implicit measures to analyze data without writing DAX.
An implicit measure is what it’s called when you aggregate a numerical column in Power BI without writing any DAX. Instead, you add the column, and a default summarization is applied to group the data by a dimension. You can change this summarization from a set of default options. This is called implicit measure because behind the scenes, Power BI is creating the measure for you on-the-fly in the DAX query generated by the visual.
The following image depicts an example of an implicit measure Sum of Quantity from the Quantity column, grouped by the text column Category in the visual.
Implicit measures can be a good option for business users or people who are new to Power BI, particularly if they have no prior experience writing code. Additionally, even experienced developers might use implicit measures when doing a quick, ad hoc analysis (for instance when exploring data or analyzing a short-lived model).
If you do plan to use implicit measures, consider the following points.
'Orders'[Order Number].Implicit measures can be problematic and come with some caveats that you should be aware of.
While implicit measures have some valid use-cases, it’s generally preferred that you create explicit measures instead. Explicit measures are simply the DAX measures that you define yourself explicitly in the model (or in the connected “thin” report). The following example is the explicit measure version of the implicit measure from the previous image.
The only way to know what aggregations are used by an implicit measure is by checking each visual manually or inspecting the report metadata, such as report.json in a PBIP or PBIX file. This is also where you can find the expressions of visual calculations.
The following section describes more details about explicit DAX measures, and when you might use them instead of other DAX objects like calculated columns or tables.
When you write DAX expressions, you do so in different object types: measures, calculated columns, or calculated tables.
A common question asked by people new to DAX and Power BI is Should I make a measure or a calculated column? Generally, many new users prefer calculated columns because they compute a result and yield immediate feedback that you see in cells and tables (like Excel). In contrast, measures require that you think about the context in which that measure will be evaluated, and whether you need to modify that context in the calculation itself by using CALCULATE.
Use calculated columns in scenarios like the following:
Depending on the type of model you are making, you might not be able to create calculated columns or tables. If you have specific use-cases that require one of these objects, this might motivate your decision to use one storage mode or another.
The following figure gives an overview of which DAX objects you can create in the different semantic model storage modes available in Power BI, today.
In summary, the following restrictions apply to some types of semantic models. Note that the storage mode is set per table, except for Direct Lake, which doesn’t support combining tables of different storage modes (the entire model uses Direct Lake storage mode).
Direct Lake support has changed since this article was first written. As of June 28, 2026, Direct Lake is a Power BI semantic model storage mode in Microsoft Fabric, but some modeling capabilities still depend on the Direct Lake mode and scenario. Check the current Microsoft Direct Lake documentation before relying on calculated columns or calculated tables.
DAX is where your semantic model starts to do real work: it turns the tables and relationships you've built into the calculations your reports actually show. It's a small language with a deceptively steep learning curve, so start with measures, lean on the model you've already shaped, and build up from there. The next articles in this series go deeper into writing and organizing that DAX.
Take your semantic models further with Tabular Editor.
Give Tabular Editor a spin