
DAX (Measure, Calculated Column, Calculated Table) – Complete Beginner to Advanced Guide for Power BI
Introduction
DAX (Measure, Calculated Column, Calculated Table)If you’re working with Power BI, mastering DAX is like learning the grammar of a new language — it’s essential for analysis and data modeling.
DAX (Data Analysis Expressions) is the formula language used in Power BI for creating:
- Measures (for dynamic aggregations)
- Calculated Columns (for row-level operations)
- Calculated Tables (for custom table logic)
Whether you’re a beginner or diving deep into advanced modeling, DAX is the heart of analytical power in Power BI.
This guide will walk you through the difference between Measures, Calculated Columns, and Calculated Tables — and when to use which — with examples and real-world use cases.
Learn from Microsoft’s Official DAX Documentation
Beginner Level – What is DAX?
What is DAX?
DAX (Data Analysis Expressions) is a formula language used in:
- Power BI
- Excel Power Pivot
- SSAS Tabular
It’s built to perform calculations on data models. Unlike Excel, DAX works on entire columns and relationships, not individual cells.
Want to master this? Join our Power BI & Data Analytics Course
The Building Blocks of DAX
1. Calculated Column
Used when you want to add a new column in your table, row-by-row.
Example:
daxCopyEditProfit = Sales[Revenue] - Sales[Cost]
Tip: Calculated columns are materialized in the model — they increase memory usage.
2. Measure
Used when you need to perform aggregations like SUM, AVERAGE, COUNT, etc.
Example:
daxCopyEditTotal Sales = SUM(Sales[Revenue])
Measures are calculated on the fly and are context-aware — they adjust based on filters and visuals.
3. Calculated Table
Used to create a new table based on DAX expressions — useful for custom aggregations, summaries, or filtering.
Example:
daxCopyEditTopProducts =
TOPN(5, Products, Products[Sales], DESC)
Tip: Calculated tables are static until refreshed.
Intermediate Level – Key DAX Concepts
Filter Context vs Row Context
- Row Context: Happens in calculated columns — evaluates row by row
- Filter Context: Happens in measures — evaluates based on filter selections
RELATED() vs RELATEDTABLE()
Function | Usage |
---|---|
RELATED() | Bring column from a related table |
RELATEDTABLE() | Return table from a related child table |
Covered in depth in Interview Prep
Advanced Level – Complex DAX Logic
1. Time Intelligence
daxCopyEditYTD Sales = TOTALYTD(SUM(Sales[Revenue]), 'Date'[Date])
Used for calculating:
- Year-to-Date (YTD)
- Month-over-Month (MoM)
- Rolling averages
2. Variables in DAX
Use VAR
to simplify and optimize DAX formulas:
daxCopyEditVAR Profit = [Revenue] - [Cost]
RETURN Profit / [Revenue]
Helps with readability and performance.
3. CALCULATE() – The Superpower
daxCopyEditSales_US = CALCULATE(SUM(Sales[Revenue]), Customers[Country] = "USA")
Changes the filter context of a measure — most used and most misunderstood.
When to Use What?
Goal | Use This |
---|---|
Need new column | Calculated Column |
Need custom aggregation | Measure |
Need dynamic or filtered table | Calculated Table |
We break this down step-by-step in our Data Analytics Course
Real-World Use Cases
- Monthly Profit Margin using Measures
- Classifying Customers by Lifetime Value using Calculated Columns
- Top 5 Regions with Highest Sales using Calculated Table
Internal Links to Help You Learn
Section | Internal Link |
---|---|
Join Courses | Join Now |
Data Analytics Intro | Explore Data Analytics |
Interview Questions | Interview DAX Set |
Contact for Help | Get in Touch |