Bird
Raised Fist0
Power BIbi_tool~8 mins

Why DAX powers calculations in Power BI - Dashboard Impact

Choose your learning style10 modes available
Dashboard Mode - Why DAX powers calculations in Power BI
Business Question

How can we use DAX formulas in Power BI to calculate total sales, average sales, and sales growth to better understand our business performance?

Sample Data
MonthSalesCost
110060
215090
3200120
4180110
5220130
Dashboard Components
  • KPI Card: Total Sales
    Formula: Total Sales = SUM(SalesData[Sales])
    Result: 850
  • KPI Card: Average Sales
    Formula: Average Sales = AVERAGE(SalesData[Sales])
    Result: 170
  • KPI Card: Total Cost
    Formula: Total Cost = SUM(SalesData[Cost])
    Result: 510
  • Calculated Measure: Sales Growth from Previous Month
    Formula:
    Sales Growth = VAR CurrentMonth = MAX(SalesData[Month]) VAR CurrentSales = CALCULATE(SUM(SalesData[Sales]), SalesData[Month] = CurrentMonth) VAR PrevMonth = CALCULATE(MAX(SalesData[Month]), FILTER(SalesData, SalesData[Month] < CurrentMonth)) VAR PrevSales = CALCULATE(SUM(SalesData[Sales]), SalesData[Month] = PrevMonth) RETURN IF(NOT(ISBLANK(PrevSales)), (CurrentSales - PrevSales) / PrevSales, BLANK())
    Example for Month 2: (150 - 100) / 100 = 0.5 (50%)
  • Line Chart: Sales Over Months
    X-axis: Month
    Y-axis: Sales
    Shows sales trend from month 1 to 5
Dashboard Layout
+----------------------+----------------------+----------------------+
|   Total Sales (KPI)  |  Average Sales (KPI) |   Total Cost (KPI)   |
+----------------------+----------------------+----------------------+
|                                                      
|                 Line Chart: Sales Over Months         
|                                                      
+------------------------------------------------------+
|               Sales Growth (Table or Card)            
+------------------------------------------------------+
Interactivity

A slicer for Month allows filtering the data shown in all components. Selecting a specific month updates the KPIs and the sales growth measure to reflect that month's data. The line chart updates to show sales only up to the selected month. This helps users focus on specific time periods.

Self Check

If you add a filter to show only months from 3 to 5, which components update and how?

  • All KPI cards update to show totals and averages for months 3, 4, and 5 only.
  • The line chart shows sales data only for months 3, 4, and 5.
  • The sales growth measure recalculates growth between these months.
Key Result
A Power BI dashboard showing total sales, average sales, total cost, sales growth, and sales trend over months using DAX calculations.

Practice

(1/5)
1. What is the main purpose of DAX in Power BI?
easy
A. To perform calculations and create measures
B. To design the layout of reports
C. To import data from external sources
D. To create visual themes and colors

Solution

  1. Step 1: Understand DAX role in Power BI

    DAX is a formula language used to create calculations like sums and averages.
  2. Step 2: Differentiate from other tasks

    Designing layouts, importing data, and theming are done by other Power BI features, not DAX.
  3. Final Answer:

    To perform calculations and create measures -> Option A
  4. Quick Check:

    DAX = calculations [OK]
Hint: DAX = calculations, not design or import [OK]
Common Mistakes:
  • Confusing DAX with report design tools
  • Thinking DAX imports data
  • Assuming DAX controls colors or themes
2. Which of the following is the correct syntax to create a simple sum measure in DAX?
easy
A. Total Sales = SUM(Sales[Amount])
B. Total Sales := SUM(Sales[Amount])
C. Total Sales = SUMM(Sales[Amount])
D. Total Sales = SUM[Sales.Amount]

Solution

  1. Step 1: Review correct DAX sum syntax

    The SUM function uses parentheses and column reference with table[column] format.
  2. Step 2: Identify syntax errors in other options

    Total Sales := SUM(Sales[Amount]) uses := which is incorrect in Power BI measures; Total Sales = SUMM(Sales[Amount]) misspells SUM; Total Sales = SUM[Sales.Amount] uses wrong column reference syntax.
  3. Final Answer:

    Total Sales = SUM(Sales[Amount]) -> Option A
  4. Quick Check:

    SUM function syntax = Total Sales = SUM(Sales[Amount]) [OK]
Hint: SUM uses parentheses and table[column] format [OK]
Common Mistakes:
  • Using := instead of = for measures
  • Misspelling function names like SUMM
  • Incorrect column reference syntax
3. Given the DAX measure:
Average Sales = AVERAGE(Sales[Amount])
What will this measure return when used in a report?
medium
A. The total sum of all sales amounts
B. The average value of the sales amounts
C. The count of sales transactions
D. The maximum sales amount

Solution

  1. Step 1: Understand the AVERAGE function

    AVERAGE calculates the mean value of the specified column's numbers.
  2. Step 2: Compare with other options

    SUM gives total, COUNT counts rows, MAX finds highest value, so they don't match the measure.
  3. Final Answer:

    The average value of the sales amounts -> Option B
  4. Quick Check:

    AVERAGE function returns mean = The average value of the sales amounts [OK]
Hint: AVERAGE means mean value, not sum or count [OK]
Common Mistakes:
  • Confusing AVERAGE with SUM or COUNT
  • Assuming it returns max value
  • Ignoring function purpose
4. Identify the error in this DAX measure:
Profit = SUM(Sales[Amount]) - SUM(Costs[Cost)
medium
A. Minus sign (-) is not allowed in DAX
B. SUM function cannot be used with Costs table
C. Measure name cannot be 'Profit'
D. Missing closing bracket in Costs column reference

Solution

  1. Step 1: Check syntax of column references

    The Costs column reference is missing a closing bracket ")" after Costs[Cost].
  2. Step 2: Validate other parts

    SUM can be used on any numeric column; measure names can be any valid identifier; minus sign is valid for subtraction.
  3. Final Answer:

    Missing closing bracket in Costs column reference -> Option D
  4. Quick Check:

    Bracket mismatch causes syntax error = Missing closing bracket in Costs column reference [OK]
Hint: Check all brackets carefully in column references [OK]
Common Mistakes:
  • Ignoring missing or extra brackets
  • Thinking function usage is wrong
  • Assuming measure names are restricted
  • Misunderstanding operators allowed
5. You want to create a measure that calculates the total sales only for the current year dynamically. Which DAX expression correctly achieves this?
hard
A. Total Sales CY = SUM(Sales[Amount]) WHERE YEAR(Sales[Date]) = YEAR(TODAY())
B. Total Sales CY = CALCULATE(SUM(Sales[Amount]), YEAR(Sales[Date]) = YEAR(TODAY()))
C. Total Sales CY = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, YEAR(Sales[Date]) = YEAR(TODAY())))
D. Total Sales CY = SUMX(FILTER(Sales, Sales[Date] = TODAY()), Sales[Amount])

Solution

  1. Step 1: Understand CALCULATE with FILTER usage

    CALCULATE modifies filter context; FILTER creates a table filtered by year matching current year.
  2. Step 2: Analyze each option's correctness

    Total Sales CY = CALCULATE(SUM(Sales[Amount]), YEAR(Sales[Date]) = YEAR(TODAY())) uses a boolean expression directly inside CALCULATE which is invalid; Total Sales CY = SUM(Sales[Amount]) WHERE YEAR(Sales[Date]) = YEAR(TODAY()) uses SQL-like WHERE which is not DAX syntax; Total Sales CY = SUMX(FILTER(Sales, Sales[Date] = TODAY()), Sales[Amount]) filters only today's date, not the whole year.
  3. Final Answer:

    Total Sales CY = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, YEAR(Sales[Date]) = YEAR(TODAY()))) -> Option C
  4. Quick Check:

    Use CALCULATE with FILTER for dynamic year filter [OK]
Hint: Use CALCULATE with FILTER for dynamic date filters [OK]
Common Mistakes:
  • Using boolean conditions directly in CALCULATE
  • Applying SQL syntax like WHERE in DAX
  • Filtering only one day instead of full year
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard