Course: Complete Introduction to Microsoft Power BI
In this introduction chapter we explore the fundamentals of Power BI DAX (Data Analysis Expressions), a formula language used across Power BI, Excel, and other Microsoft tools. DAX enables analysts to create calculated columns, dynamic measures, and calculated tables that enrich data models and support advanced reporting. Calculated columns compute values row-by-row, while measures evaluate aggregates dynamically based on filter context in visuals. Calculated tables can generate supportive dimensions like calendars using functions such as CALENDAR and can be the basis for time intelligence. SUMMARIZECOLUMNS lets you group and aggregate data with optional filters and custom measures, yielding concise summary tables for reporting. When writing DAX queries with EVALUATE, remember to explicitly specify ORDER BY because Power BI visuals’ sort settings are not applied automatically. The START AT clause in DAX queries can be used to paginate or focus a query result beginning at a particular key value. Best practices include creating a dedicated date table, using DIVIDE to avoid divide-by-zero errors, and favoring measures for calculations that should respond to visuals. Mastering these building blocks unlocks complex analytics like year-over-year comparisons, rolling averages, and category-level profitability. Throughout the course we will practice creating calculated tables, summarizing data, and composing robust DAX queries to produce interactive reports and dashboards. By the end of the chapter you should be able to create basic DAX formulas, construct summary queries, and understand the differences between columns, measures, and tables. Hands-on practice with the provided training files will cement these concepts and prepare you for advanced DAX topics.Power BI DAX — Lecture Sheet
Lesson
Topic: Introduction to Power BI DAX — Calculated Columns, Measures, and Calculated Tables
Learning Outcomes
- Understand what DAX is and where it is used (Power BI, Excel, Analysis Services).
- Differentiate between calculated columns, measures and calculated tables.
- Create a calendar (date) table with DAX.
- Summarize data using SUMMARIZECOLUMNS and write basic EVALUATE queries.
- Order query results explicitly and use START AT for targeted retrieval.
Conceptual Explanation
DAX (Data Analysis Expressions) is a columnar formula language optimized for relational in-memory models. It allows model authors to define calculated columns, measures, and calculated tables that extend the data model and enable advanced analysis. Calculated columns compute a value for each row and are stored in the model; measures are evaluated at query time and adapt to filter context in visuals; calculated tables are new tables created by DAX expressions.
Key DAX building blocks:
- CALCULATED COLUMN: Row-by-row expressions. Example:
Total Sales = 'Sales'[Quantity] * 'Sales'[Unit Price] - MEASURE: Aggregation evaluated by query context. Example:
Total Sales Profit = SUM('Sales'[Sales Amount]) - SUM('Sales'[Cost Amount]) - CALCULATED TABLE: New table expression. Example:
Dim_Calendar = CALENDAR(MIN('Fact_StrategyPlan'[Datekey]), MAX('Fact_StrategyPlan'[Datekey]))
Summarization and queries:
EVALUATE
SUMMARIZECOLUMNS(
'Date'[Month Name],
'Date'[Month of Year],
'Product'[Category],
FILTER( VALUES('Product'[Category]), [Category] = "Clothing" ),
"Orders", [Orders],
"Avg Profit per Order", DIVIDE( [Total Sales Profit], [Orders] )
)
ORDER BY 'Date'[Month of Year] ASC
Notes on ordering: DAX queries using EVALUATE do not inherit the report visual sort; include ORDER BY explicitly. Use START AT to begin results at a particular key:
EVALUATE
'Sales Order'
ORDER BY 'Sales Order'[Sales Order] ASC
START AT "SO43661"
Bilingual (EN → বাংলা)
| English | বাংলা |
|---|---|
| Calculated Column | ক্যালকুলেটেড কলাম — প্রতিটি সারির জন্য গণনা |
| Measure | মিনি—ডাইনামিক গণনা, ভিসুয়াল কনটেক্সট অনুযায়ী মূল্য নির্ধারণ করে |
| Calculated Table | ক্যালকুলেটেড টেবল — DAX দ্বারা তৈরি একটি নতুন টেবিল |
| CALENDAR | তারিখ টেবিল তৈরির DAX ফাংশন |
| SUMMARIZECOLUMNS | ডেটা গ্রুপিং ও সারসংক্ষেপ করতে ব্যবহৃত ফাংশন |
Important Notes
- Prefer measures for calculations that must react to filters and visuals.
- Use DIVIDE(a,b) instead of a/b to avoid division-by-zero errors.
- Create a dedicated date table (Dim_Calendar) and relate it to fact tables for time intelligence.
- DAX queries in the query pane require ORDER BY when a specific sort is needed.
- Calculated columns increase model size; use them judiciously.
Exercises → True / False / Fill in the Blanks / MCQ / Matching / Descriptive / Creative
True / False
- Measures are computed and stored per row in the data model.
- The CALENDAR function can be used to build a continuous date table.
- SUMMARIZECOLUMNS automatically respects the sort order defined in Power BI visuals.
Answer
False — measures are computed on demand and evaluated in the filter context; calculated columns are stored per row.
Answer
True — CALENDAR(MIN(...), MAX(...)) creates a continuous date column between two dates.
Answer
False — DAX queries do not inherit visual sort; you must include ORDER BY explicitly in the query.
Fill in the Blanks
- A DAX function that safely divides two numbers and handles divide-by-zero is _______.
- To create a calendar table spanning dates in Fact_StrategyPlan, use _______ in DAX.
Answer
DIVIDE()
Answer
Dim_Calendar = CALENDAR(MIN('Fact_StrategyPlan'[Datekey]), MAX('Fact_StrategyPlan'[Datekey]))
Multiple Choice Questions (MCQ)
- Which DAX function groups columns and returns a table for use with EVALUATE?
- A. FILTER
- B. SUMMARIZECOLUMNS
- C. CALCULATE
- D. VALUES
- To force a DAX query result to start at a specific key you use:
- A. LIMIT
- B. OFFSET
- C. START AT
- D. BEGIN
Answer
B. SUMMARIZECOLUMNS
Answer
C. START AT
Matching
Match the term (left) to its purpose (right):
| Term | Purpose |
|---|---|
| CALCULATE | 1. Change filter context for an expression |
| CALENDAR | 2. Create date ranges |
| SUMMARIZECOLUMNS | 3. Group and summarize columns |
| DIVIDE | 4. Safe division |
Answer
CALCULATE → 1; CALENDAR → 2; SUMMARIZECOLUMNS → 3; DIVIDE → 4.
Descriptive
Explain when you would use a calculated column vs a measure. (2–4 sentences)
Answer
Use a calculated column when you need a value at the row level that will be used like a field (for slicers, relationships, or grouping). Use a measure when you require dynamic aggregation that responds to slicers, filters and visual context — it is evaluated at query time and does not increase row storage.
Creative
Design a small report idea (title, two visuals, one slicer) that uses a Dim_Calendar and SUMMARIZECOLUMNS.
Answer
Title: "Clothing Sales Monthly Insights". Visual 1: Clustered column chart showing Orders by Month (Dim_Calendar[Month Name]). Visual 2: Card visuals for Total Orders and Avg Profit per Order (measures used). Slicer: Product[Category] to filter to Clothing. Use a summarized table built with SUMMARIZECOLUMNS to power a table visual of month, orders and avg profit per order.
Activities, Vocabulary, Homework, Practice Task
Activities
- Create Dim_Calendar using your fact table dates; add Year, Month and Quarter columns.
- Write a measure Total Sales and use it in a card visual.
Answer
DAX example:
Dim_Calendar =
ADDCOLUMNS(
CALENDAR(MIN('Fact_StrategyPlan'[Datekey]), MAX('Fact_StrategyPlan'[Datekey])),
"Year", YEAR([Date]),
"Month Name", FORMAT([Date],"MMMM"),
"Month of Year", MONTH([Date]),
"Quarter", "Q" & QUARTER([Date])
)
Answer
Measure:
Total Sales = SUM('Sales'[SalesAmount])
Vocabulary
- Filter context — set of filters applied to a measure evaluation.
- Row context — context of the current row when evaluating calculated columns.
- Context transition — how CALCULATE changes filter context.
Homework
- Download the training dataset and import into Power BI Desktop.
- Create Dim_Calendar and relate it to your fact table.
- Build a SUMMARIZECOLUMNS query that returns Orders and Avg Profit per Order by month for Clothing.
Answer
Example query:
EVALUATE
SUMMARIZECOLUMNS(
'Dim_Calendar'[Month Name],
'Dim_Calendar'[Month of Year],
FILTER( VALUES('Product'[Category]), [Category] = "Clothing" ),
"Orders", [Orders],
"Avg Profit per Order", DIVIDE( [Total Sales Profit], [Orders] )
)
ORDER BY 'Dim_Calendar'[Month of Year] ASC
Practice Task
Implement a DAX query that returns the first 50 sales orders starting at "SO43661" ordered ascending by Sales Order.
Answer
Use EVALUATE with ORDER BY and START AT; pagination to 50 rows is environment dependent, but DAX START AT limits the starting key:
EVALUATE
'Sales Order'
ORDER BY 'Sales Order'[Sales Order] ASC
START AT "SO43661"
To limit rows in DAX Query Explorer you can use TOPN in an EVALUATE expression:
EVALUATE
TOPN(50, 'Sales Order', 'Sales Order'[Sales Order], ASC)
References & Further Reading: Power BI documentation, DAX guide by Microsoft, community blogs and DAX reference pages.