Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Power Query for Data Analysis ยท Lesson 15 of 17

Module Fourteen

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
15
Module 14 ยท Power Query for Data Analysis Expert

๐Ÿงฎ Module Fourteen: Introduction to DAX

Hello, young data explorer! Welcome to Module Fourteen. In this module, we will learn about DAX โ€“ Data Analysis Expressions. DAX is a language that helps us create powerful calculations in Power BI. Think of DAX as a magic wand that can answer any question you have about your data. You can create new columns, make calculations, and build advanced measures. By the end of this module, you will be able to write your own DAX formulas and make your reports smarter!

๐ŸŽฏ Learning Objectives

  • Understand what DAX is and why it's important.
  • Learn the difference between calculated columns and measures.
  • Learn about basic DAX functions: SUM, AVERAGE, COUNT.
  • Learn about CALCULATE and its power.
  • Learn about time intelligence functions (TOTALYTD, SAMEPERIODLASTYEAR).
  • Learn about FILTER and row context.
  • Understand the concept of context in DAX.
  • Learn about common DAX patterns.
  • Write your own DAX formulas.
  • Use DAX to solve real-world problems.

๐Ÿ“– Warm-up Story: The Magic Calculator

Chidi has a magic calculator. He can ask it questions like: "What is the total sales for this year?" or "What is the average score of students?" and it answers instantly. The magic calculator is like DAX โ€“ it can answer any question about your data. You just need to write the right formula, and the answer appears!

๐Ÿ“š Main Lessons (15 Lessons)

Lesson 1: What is DAX?

Definition: DAX stands for Data Analysis Expressions. It's a language used to create calculations in Power BI.

Why important: DAX allows you to ask questions and get answers from your data.

Simple explanation: It's like a magic language that turns data into answers.

Real-life example: A store uses DAX to calculate total sales.

School example: A teacher uses DAX to calculate average scores.

Home example: You use DAX to calculate total expenses.

Nigerian example: A bank uses DAX to calculate total deposits.

Illustration:

Data + DAX = Answers
Sales Table + DAX = Total Sales

Mini summary: DAX is the language for creating calculations in Power BI.

Lesson 2: Calculated Columns vs Measures

Definition: Calculated columns are added to a table and evaluated row by row. Measures are calculated on the fly based on the context.

Why important: Knowing the difference helps you use DAX correctly.

Simple explanation: Calculated columns are like permanent additions. Measures are like temporary answers that change.

Real-life example: Calculated column: "Profit" = [Sales] - [Cost]. Measure: Total Sales = SUM([Sales]).

School example: Calculated column: "Total Score" = [Exam] + [Assignment]. Measure: Average Score = AVERAGE([Total Score]).

Home example: Calculated column: "Adjusted Price" = [Price] + [Tax]. Measure: Total Budget = SUM([Adjusted Price]).

Nigerian example: Calculated column: "Net Salary" = [Gross] - [Tax]. Measure: Total Payroll = SUM([Net Salary]).

Illustration:

Calculated Column: Adds data to a table (row by row).
Measure: Calculates data on the fly (dynamic).

Mini summary: Calculated columns are row-level; measures are dynamic.

Lesson 3: Basic DAX Functions โ€“ SUM

Definition: SUM adds all the numbers in a column.

Why important: It's the most used function for totals.

Simple explanation: It adds up numbers, just like a calculator.

Real-life example: Total Sales = SUM(Sales[Amount]).

School example: Total Marks = SUM(Grades[Score]).

Home example: Total Expenses = SUM(Budget[Amount]).

Nigerian example: Total Votes = SUM(Votes[Count]).

How to write: Measure = SUM(Table[Column]).

Illustration:

Sales[Amount] = [100, 150, 200]
SUM(Sales[Amount]) = 450

Mini summary: SUM adds numbers.

Lesson 4: Basic DAX Functions โ€“ AVERAGE

Definition: AVERAGE calculates the average of a column.

Why important: To find the typical value.

Simple explanation: It adds all numbers and divides by the count.

Real-life example: Average Sales = AVERAGE(Sales[Amount]).

School example: Average Score = AVERAGE(Grades[Score]).

Home example: Average Expense = AVERAGE(Budget[Amount]).

Nigerian example: Average Rainfall = AVERAGE(Weather[Rainfall]).

How to write: Measure = AVERAGE(Table[Column]).

Illustration:

Sales[Amount] = [100, 150, 200]
AVERAGE(Sales[Amount]) = 150

Mini summary: AVERAGE finds the mean.

Lesson 5: Basic DAX Functions โ€“ COUNT

Definition: COUNT counts the number of rows in a column.

Why important: To know how many items.

Simple explanation: It counts rows.

Real-life example: Number of Orders = COUNT(Orders[OrderID]).

School example: Number of Students = COUNT(Students[StudentID]).

Home example: Number of Expenses = COUNT(Budget[Amount]).

Nigerian example: Number of Voters = COUNT(Voters[VoterID]).

How to write: Measure = COUNT(Table[Column]).

Illustration:

Sales[Amount] = [100, 150, 200]
COUNT(Sales[Amount]) = 3

Mini summary: COUNT counts rows.

Lesson 6: Basic DAX Functions โ€“ MAX and MIN

Definition: MAX finds the highest value, MIN finds the lowest value.

Why important: To know the extremes.

Simple explanation: MAX gives the biggest, MIN gives the smallest.

Real-life example: Highest Sales = MAX(Sales[Amount]).

School example: Highest Score = MAX(Grades[Score]).

Home example: Highest Expense = MAX(Budget[Amount]).

Nigerian example: Maximum Rainfall = MAX(Weather[Rainfall]).

How to write: Measure = MAX(Table[Column]).

Illustration:

Sales[Amount] = [100, 150, 200]
MAX = 200, MIN = 100

Mini summary: MAX finds the largest, MIN finds the smallest.

Lesson 7: The CALCULATE Function

Definition: CALCULATE changes the context in which a calculation is performed.

Why important: It's the most powerful function in DAX.

Simple explanation: It's like a magnifying glass that focuses on specific data.

Real-life example: Total Sales for Year 2025 = CALCULATE(SUM(Sales[Amount]), Sales[Year] = 2025).

School example: Average Score for Math = CALCULATE(AVERAGE(Grades[Score]), Grades[Subject] = "Math").

Home example: Total Expenses for Food = CALCULATE(SUM(Budget[Amount]), Budget[Category] = "Food").

Nigerian example: Total Votes in Lagos = CALCULATE(SUM(Votes[Count]), Votes[State] = "Lagos").

How to write: Measure = CALCULATE(expression, filter).

Illustration:

CALCULATE(SUM(Sales[Amount]), Sales[Year] = 2025)
โ†’ Sum of sales only for 2025.

Mini summary: CALCULATE changes the calculation context.

Lesson 8: The FILTER Function

Definition: FILTER returns a table that is filtered based on a condition.

Why important: It's used inside CALCULATE to apply complex filters.

Simple explanation: It's like a sieve that only keeps specific rows.

Real-life example: Total Sales for Products with Price > 100 = CALCULATE(SUM(Sales[Amount]), FILTER(Products, Products[Price] > 100)).

School example: Average Score for Students with Attendance > 90% = CALCULATE(AVERAGE(Grades[Score]), FILTER(Students, Students[Attendance] > 0.9)).

Home example: Total Expenses for Categories with Amount > 1000 = CALCULATE(SUM(Budget[Amount]), FILTER(Budget, Budget[Amount] > 1000)).

Nigerian example: Total Votes for States with Population > 1M = CALCULATE(SUM(Votes[Count]), FILTER(States, States[Population] > 1000000)).

Illustration:

FILTER(Products, Products[Price] > 100)
โ†’ Only keeps products with price > 100.

Mini summary: FILTER creates a filtered table.

Lesson 9: Time Intelligence โ€“ TOTALYTD

Definition: TOTALYTD calculates the year-to-date total.

Why important: To track cumulative totals over time.

Simple explanation: It adds up values from the start of the year to the current date.

Real-life example: Sales YTD = TOTALYTD(SUM(Sales[Amount]), Dates[Date]).

School example: Marks YTD = TOTALYTD(SUM(Grades[Score]), Dates[Date]).

Home example: Expenses YTD = TOTALYTD(SUM(Budget[Amount]), Dates[Date]).

Nigerian example: Revenue YTD = TOTALYTD(SUM(Revenue[Amount]), Dates[Date]).

How to write: Measure = TOTALYTD(expression, dates column).

Illustration:

TOTALYTD(SUM(Sales[Amount]), Calendar[Date])
โ†’ Total sales from Jan 1 to today.

Mini summary: TOTALYTD gives year-to-date totals.

Lesson 10: Time Intelligence โ€“ SAMEPERIODLASTYEAR

Definition: SAMEPERIODLASTYEAR returns the same period in the previous year.

Why important: To compare performance year-over-year.

Simple explanation: It gives you the same dates but one year ago.

Real-life example: Sales Last Year = CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Dates[Date])).

School example: Scores Last Year = CALCULATE(AVERAGE(Grades[Score]), SAMEPERIODLASTYEAR(Dates[Date])).

Home example: Expenses Last Year = CALCULATE(SUM(Budget[Amount]), SAMEPERIODLASTYEAR(Dates[Date])).

Nigerian example: Revenue Last Year = CALCULATE(SUM(Revenue[Amount]), SAMEPERIODLASTYEAR(Dates[Date])).

Illustration:

CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Calendar[Date]))
โ†’ Sales for the same period last year.

Mini summary: SAMEPERIODLASTYEAR compares with the previous year.

Lesson 11: The ALL Function

Definition: ALL removes all filters from a table or column.

Why important: Useful for calculating percentages of totals.

Simple explanation: It ignores any filters and looks at everything.

Real-life example: % of Total Sales = DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALL(Sales))).

School example: % of Total Marks = DIVIDE(SUM(Grades[Score]), CALCULATE(SUM(Grades[Score]), ALL(Grades))).

Home example: % of Total Expenses = DIVIDE(SUM(Budget[Amount]), CALCULATE(SUM(Budget[Amount]), ALL(Budget))).

Nigerian example: % of Total Votes = DIVIDE(SUM(Votes[Count]), CALCULATE(SUM(Votes[Count]), ALL(Votes))).

Illustration:

DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALL(Sales)))
โ†’ Percentage of each product's sales out of total.

Mini summary: ALL removes filters.

Lesson 12: Row Context and Filter Context

Definition: Row context refers to a single row being evaluated. Filter context refers to the filters applied to the data.

Why important: Understanding context is key to writing correct DAX.

Simple explanation: Row context is like looking at one student's score. Filter context is like looking at all students from a particular class.

Real-life example: Row context: calculating profit for each product. Filter context: calculating total sales for a region.

School example: Row context: calculating total marks for a student. Filter context: calculating average marks for a subject.

Home example: Row context: calculating cost per item. Filter context: calculating total cost for a category.

Nigerian example: Row context: calculating tax per citizen. Filter context: calculating total tax for a state.

Illustration:

Row Context: Each row is evaluated individually.
Filter Context: All rows that meet certain criteria.

Mini summary: Row context = one row; Filter context = filtered rows.

Lesson 13: The DIVIDE Function

Definition: DIVIDE handles division safely, returning an alternate value if the denominator is zero.

Why important: Prevents errors in calculations.

Simple explanation: It's like a safety net for division.

Real-life example: Sales per Product = DIVIDE(SUM(Sales[Amount]), COUNT(Products[ProductID]), 0).

School example: Average per Student = DIVIDE(SUM(Grades[Score]), COUNT(Students[StudentID]), 0).

Home example: Average per Category = DIVIDE(SUM(Budget[Amount]), COUNT(Categories[CategoryID]), 0).

Nigerian example: Average per State = DIVIDE(SUM(Population[Total]), COUNT(States[StateID]), 0).

How to write: DIVIDE(numerator, denominator, alternate result).

Illustration:

DIVIDE(10, 0, 0) โ†’ 0
DIVIDE(10, 2, 0) โ†’ 5

Mini summary: DIVIDE safely handles division by zero.

Lesson 14: Common DAX Patterns

Definition: Common patterns are frequently used DAX formulas.

Why important: They save time and are proven to work.

Simple explanation: It's like using a recipe instead of inventing a new dish.

  • Total Sales = SUM(Sales[Amount])
  • Sales YTD = TOTALYTD(SUM(Sales[Amount]), Calendar[Date])
  • Sales LY = CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Calendar[Date]))
  • % of Total = DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALL(Sales)))

Illustration:

Measure: Total Sales = SUM(Sales[Amount])
Measure: Sales YTD = TOTALYTD([Total Sales], Calendar[Date])
Measure: % of Total = DIVIDE([Total Sales], CALCULATE([Total Sales], ALL(Sales)))

Mini summary: Use common patterns for efficient DAX.

Lesson 15: Best Practices for DAX

Definition: Tips for writing efficient and accurate DAX formulas.

Why important: Good DAX is fast, accurate, and easy to understand.

Simple explanation: It's like following rules to build a strong house.

  • Use measures instead of calculated columns when possible.
  • Use CALCULATE with FILTER for complex conditions.
  • Use DIVIDE instead of / for safe division.
  • Keep formulas simple and readable.
  • Test your measures with sample data.

Illustration:

1. Use measures for dynamic calculations.
2. Use CALCULATE for context changes.
3. Use DIVIDE for safe division.
4. Document your measures.

Mini summary: Follow best practices for quality DAX.

๐Ÿ“– Key Vocabulary (with simple definitions)

  • DAX: Data Analysis Expressions โ€“ a language for calculations.
  • Calculated Column: A column added to a table, evaluated row by row.
  • Measure: A calculation evaluated on the fly.
  • SUM: Adds numbers.
  • AVERAGE: Calculates the mean.
  • COUNT: Counts rows.
  • MAX: Finds the highest value.
  • MIN: Finds the lowest value.
  • CALCULATE: Changes the calculation context.
  • FILTER: Creates a filtered table.
  • ALL: Removes filters.
  • DIVIDE: Safely divides numbers.
  • Time Intelligence: Functions for date calculations.

๐Ÿง  Important Concepts

  • DAX is the language of Power BI calculations.
  • Calculated columns are row-level, measures are dynamic.
  • CALCULATE is the most powerful DAX function.
  • Time intelligence functions help with date analysis.
  • Context (row context and filter context) is key to DAX.

๐Ÿ”ข Step-by-Step Explanations

How to Create a Measure in Power BI:

  1. Open Power BI Desktop.
  2. In the Fields pane, right-click on a table.
  3. Select "New Measure".
  4. Write your DAX formula in the formula bar.
  5. Press Enter.

How to Create a Calculated Column:

  1. Open Power BI Desktop.
  2. In the Fields pane, right-click on a table.
  3. Select "New Column".
  4. Write your DAX formula.
  5. Press Enter.

๐ŸŒ Real-life Examples

  • Retail: Use DAX to calculate total sales, profit margins, and year-over-year growth.
  • Healthcare: Use DAX to calculate patient visits, average length of stay, and readmission rates.
  • Finance: Use DAX to calculate revenue, expenses, and net income.

๐Ÿ‡ณ๐Ÿ‡ฌ Nigerian Examples

  • Election: Use DAX to calculate total votes per party, voter turnout, and percentage of votes.
  • Agriculture: Use DAX to calculate total crop yield, average yield per state, and year-over-year comparison.
  • Telecom: Use DAX to calculate total call minutes, average call duration, and revenue per customer.

๐ŸŽˆ Fun Examples Children Can Relate To

  • Toys: Use DAX to calculate total toys sold, average price per toy, and highest selling toy.
  • Candy: Use DAX to calculate total candy sales, average sales per day, and month-to-date sales.
  • Games: Use DAX to calculate total game scores, average score per player, and high score.

๐Ÿ  Everyday Examples

  • Budget: Use DAX to calculate total expenses, average expense per category, and year-to-date spending.
  • Chores: Use DAX to calculate total chores completed, average chores per day, and most common chore.
  • School: Use DAX to calculate total marks, average marks, and highest marks per subject.

๐Ÿ‘ฉโ€๐Ÿซ Teacher Notes

  • Start with simple functions and gradually introduce CALCULATE.
  • Emphasize the importance of context.
  • Use real-world datasets for practice.

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ Parent Tips

  • Help your child create simple measures with real data (e.g., total allowance).
  • Discuss how DAX answers questions like "How much did I spend this month?"

๐Ÿ’ก Interesting Facts

  • DAX is similar to Excel formulas but more powerful.
  • DAX has over 200 functions.
  • CALCULATE is considered the most important DAX function.

โ“ Did You Know?

Did you know that DAX was originally developed for Power Pivot in Excel? Now it's used in Power BI, Analysis Services, and even in Excel!

๐Ÿ”” Remember This

  • DAX is the language of Power BI calculations.
  • Measures are dynamic, calculated columns are static.
  • CALCULATE is the most powerful function.
  • Context is crucial in DAX.

โš ๏ธ Common Mistakes

  • Using a calculated column when a measure is needed โ€“ causes performance issues.
  • Forgetting to use CALCULATE for context changes.
  • Dividing by zero without DIVIDE โ€“ causes errors.
  • Ignoring filter context โ€“ leads to wrong results.

โœ… Best Practices

  • Use measures for aggregations.
  • Use CALCULATE to change context.
  • Use DIVIDE for safe division.
  • Test your measures thoroughly.
  • Document your DAX formulas.

๐Ÿ“Š ASCII Illustrations

Calculated Column vs Measure

Calculated Column:
+----------+----------+----------+
| Product  | Price    | Tax      |
+----------+----------+----------+
| Toy      | 100      | = Price*0.1 (calculated row by row) |
+----------+----------+----------+

Measure:
Total Sales = SUM(Sales[Amount])  (dynamic calculation)

CALCULATE Flow

Expression  โ†’  CALCULATE  โ†’  Result
   โ†“              โ†“
 SUM(Sales)   Filter: Year = 2025
   โ†“              โ†“
   โ†’  CALCULATE(SUM(Sales), Sales[Year]=2025)  โ†’  Total Sales for 2025

๐Ÿ“‹ Comparison Tables

Calculated Column vs Measure

FeatureCalculated ColumnMeasure
EvaluationRow by rowOn the fly
StorageStored in tableNot stored
PerformanceSlowerFaster
Use caseRow-level calculationsAggregations

Basic DAX Functions

FunctionWhat it doesExample
SUMAdds numbersSUM(Sales[Amount])
AVERAGECalculates meanAVERAGE(Sales[Amount])
COUNTCounts rowsCOUNT(Sales[OrderID])
MAXFinds highestMAX(Sales[Amount])
MINFinds lowestMIN(Sales[Amount])

๐Ÿ“ End-of-Module Summary

Congratulations! You have completed Module Fourteen on Introduction to DAX. You learned:

  • What DAX is and how it's used.
  • The difference between calculated columns and measures.
  • Basic DAX functions: SUM, AVERAGE, COUNT, MAX, MIN.
  • How to use CALCULATE to change context.
  • Time intelligence functions like TOTALYTD and SAMEPERIODLASTYEAR.
  • How to use FILTER and ALL.
  • About row context and filter context.
  • Best practices for writing DAX.

You now have the skills to create powerful calculations and make your reports truly intelligent!

โ“ Frequently Asked Questions (10)

  1. What is DAX? โ€“ Data Analysis Expressions, a language for calculations in Power BI.
  2. What is a measure? โ€“ A dynamic calculation.
  3. What is a calculated column? โ€“ A column added to a table.
  4. What does SUM do? โ€“ Adds numbers.
  5. What does AVERAGE do? โ€“ Calculates the mean.
  6. What does COUNT do? โ€“ Counts rows.
  7. What is CALCULATE? โ€“ A function that changes context.
  8. What is TOTALYTD? โ€“ Calculates year-to-date totals.
  9. What is the difference between row context and filter context? โ€“ Row context is one row; filter context is filtered rows.
  10. What is DIVIDE used for? โ€“ Safe division.

๐Ÿ“ Review Questions (15)

  1. What is DAX?
  2. What is a measure?
  3. What is a calculated column?
  4. What does SUM do?
  5. What does AVERAGE do?
  6. What does COUNT do?
  7. What does MAX do?
  8. What does MIN do?
  9. What is CALCULATE?
  10. What is TOTALYTD?
  11. What is SAMEPERIODLASTYEAR?
  12. What is FILTER?
  13. What is ALL?
  14. What is the difference between row context and filter context?
  15. What is DIVIDE used for?

โœ๏ธ Fill-in-the-Blank Exercises

  1. ______ is a language for calculations in Power BI.
  2. A ______ is a dynamic calculation.
  3. ______ adds numbers.
  4. ______ changes the calculation context.
  5. ______ calculates year-to-date totals.

โœ… True or False Exercises

  1. DAX stands for Data Analysis Expressions. (True)
  2. A calculated column is dynamic. (False)
  3. A measure is evaluated row by row. (False)
  4. CALCULATE changes context. (True)
  5. TOTALYTD calculates month-to-date totals. (False)

๐Ÿ”˜ Multiple Choice Questions (15 with answers)

  1. What is DAX?
    a) Data Analysis Expressions b) Data Aggregation X c) Direct Access X d) Digital Analysis X
    Answer: a
  2. What is a measure?
    a) A dynamic calculation b) A static column c) A table d) A chart
    Answer: a
  3. What does SUM do?
    a) Counts rows b) Adds numbers c) Averages numbers d) Finds the maximum
    Answer: b
  4. What does AVERAGE do?
    a) Adds numbers b) Counts rows c) Calculates the mean d) Finds the minimum
    Answer: c
  5. What does COUNT do?
    a) Adds numbers b) Counts rows c) Averages numbers d) Finds the maximum
    Answer: b
  6. What is CALCULATE?
    a) A function that changes context b) A function that adds numbers c) A function that counts rows d) A function that finds the maximum
    Answer: a
  7. What is TOTALYTD?
    a) Year-to-date total b) Month-to-date total c) Day-to-date total d) Quarter-to-date total
    Answer: a
  8. What is SAMEPERIODLASTYEAR used for?
    a) Comparing with previous year b) Comparing with next year c) Comparing with current year d) Comparing with previous month
    Answer: a
  9. What is FILTER used for?
    a) Creating a filtered table b) Removing filters c) Adding columns d) Deleting rows
    Answer: a
  10. What is ALL used for?
    a) Removing filters b) Adding filters c) Creating tables d) Counting rows
    Answer: a
  11. What is DIVIDE used for?
    a) Safe division b) Adding numbers c) Counting rows d) Finding maximum
    Answer: a
  12. What is row context?
    a) Evaluating one row at a time b) Evaluating all rows c) Removing filters d) Adding filters
    Answer: a
  13. What is filter context?
    a) Filters applied to data b) One row c) A new column d) A measure
    Answer: a
  14. Which is a measure?
    a) SUM(Sales[Amount]) b) Sales[Amount] c) Sales d) Amount
    Answer: a
  15. Which is a calculated column?
    a) [Profit] = [Sales] - [Cost] b) SUM(Sales[Amount]) c) AVERAGE(Sales[Amount]) d) COUNT(Sales[OrderID])
    Answer: a

๐Ÿ”— Matching Exercises

Match the function to its description:

FunctionDescription
1. SUMA. Calculates the mean
2. AVERAGEB. Adds numbers
3. COUNTC. Finds the highest value
4. MAXD. Counts rows
5. CALCULATEE. Changes context

Answers: 1-B, 2-A, 3-D, 4-C, 5-E

โœ๏ธ Short Answer Questions

  1. What is DAX and why is it important?
  2. Explain the difference between a calculated column and a measure.
  3. What is CALCULATE and when would you use it?
  4. What is time intelligence? Give an example.
  5. Why is DIVIDE better than the / operator?

๐Ÿ“– Scenario-based Exercises

Scenario 1: You have a sales table with columns: Product, Amount, Date. Write a DAX measure to calculate total sales for the year 2025.

Scenario 2: You have a student grades table with columns: Student, Subject, Score. Write a DAX measure to calculate the average score for Math.

๐Ÿ‘ฅ Group Activity

In groups, choose a dataset (e.g., sales data). Create at least five DAX measures: Total Sales, Average Sales, Max Sales, Min Sales, and Sales YTD. Present your measures and explain how they work.

๐Ÿง‘โ€๐ŸŽ“ Individual Activity

Load a sample dataset into Power BI. Create a calculated column (e.g., Profit = Sales - Cost) and a measure (e.g., Total Sales = SUM(Sales)). Write at least three more measures of your choice.

๐Ÿ’ฌ Classroom Discussion Questions

  • Why is DAX important for data analysis?
  • What are some challenges you faced when writing DAX?
  • How does context affect DAX calculations?

๐Ÿ› ๏ธ Mini Project

Project: DAX Sales Dashboard

Build a sales dashboard using DAX. Include measures for: Total Sales, Total Sales YTD, Sales Last Year, Average Sales per Product, and % of Total Sales. Add a chart that shows sales by month. Use time intelligence functions.

๐Ÿ“‹ Practical Assignment

Download a dataset with at least 1,000 rows. Create a data model and write at least 10 DAX measures. Include measures that use CALCULATE, FILTER, and time intelligence. Document your measures.

๐Ÿ† Challenge Exercise

Write a DAX measure that calculates the moving average of sales over the last 3 months. Use CALCULATE and FILTER. Test it with sample data.

๐Ÿ“ Quiz Answers

Fill-in-the-Blank: 1. DAX, 2. measure, 3. SUM, 4. CALCULATE, 5. TOTALYTD

True/False: 1-T, 2-F, 3-F, 4-T, 5-F

Matching: 1-B, 2-A, 3-D, 4-C, 5-E

๐Ÿ”‘ Key Takeaways

  • DAX is the language for calculations in Power BI.
  • Measures are dynamic and powerful.
  • CALCULATE is the most important DAX function.
  • Time intelligence helps with date-based analysis.
  • Always test your DAX measures.

๐Ÿ“– Preparation for the Next Module

In Module Fifteen, we will learn about Advanced DAX Patterns โ€“ we will explore more complex calculations like ranking, running totals, and dynamic segmentation. You will become a true DAX master!

Before the next class, practice writing DAX measures with CALCULATE and time intelligence. Try to create at least five different measures.


ยฉ 2025 Certified Power Query for Data Analysis Expert โ€“ Module Fourteen

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’