Logan's Analytics Bootcamp
Dashboard β€Ί Phase 2: Power BI
M2.4

DAX Fundamentals

⏱ 8 hoursπŸ“… Week 10❓ 4 quiz questions
Phase 2 goal

Build governed, refreshable, interactive program dashboards. Get data in shape with Power Query M, model it as a star schema, calculate it with DAX, present it well, and publish it securely.

🎯 Learning objectives

Tick each one when you can actually do it.

πŸ’‘ Key concepts

  • Measures calculate at query time in the current filter context. Use them for nearly all numbers on a report. Calculated columns calculate row by row at refresh and are stored. Use them for slicing and grouping attributes.
  • Filter context: The set of filters from slicers, rows/columns of a visual, and page/report filters.
  • Row context: "The current row", present in calculated columns and iterators (SUMX, FILTER).
  • CALCULATE: Changes filter context. The most important DAX function.
    BCWP = SUM ( fact_EVM[BCWP] )
    ACWP = SUM ( fact_EVM[ACWP] )
    BCWS = SUM ( fact_EVM[BCWS] )
    
    CPI = DIVIDE ( [BCWP], [ACWP] )
    SPI = DIVIDE ( [BCWP], [BCWS] )
    CV  = [BCWP] - [ACWP]
    SV  = [BCWP] - [BCWS]
    
    RDT&E Actual Obligations =
        CALCULATE ( SUM ( fact_Budget[ActualObligation] ), dim_Appropriation[Appropriation] = "RDT&E" )
    
    Late Milestones =
        CALCULATE (
            COUNTROWS ( fact_Milestones ),
            ISBLANK ( fact_Milestones[ActualDate] ),
            fact_Milestones[ForecastDate] < TODAY ()
        )
    
  • Iterators: SUMX(table, expression) evaluates row by row, then sums. Example: weighted values, risk score = SUMX(fact_Risks, fact_Risks[Likelihood] * fact_Risks[Consequence]).
  • VAR / RETURN: Name intermediate results (LET for DAX).
  • Measure tables and formatting: Put measures in a dedicated _Measures table, set formats (currency, 0.00 for indices), and use display folders (EVM, Budget, Schedule).

πŸ›  Hands-on exercise: Core Measure Library

⬇ Practice data for this module
D1 programsProgram dimension (12 rows)CSVXLSX
D2 milestonesMilestones (~150 rows)CSVXLSX
D3 evm_monthlyMonthly EVM by control account (~2,000 rows)CSVXLSX
D4 contractsContracts (30 rows)CSVXLSX
D5 budget_executionBudget execution by appropriation (1,296 rows)CSVXLSX
D6 schedule_tasksIMS task export (1,500 rows)CSVXLSX
D7 risksRisk register (80 rows)CSVXLSX

Data: the PEO-FS star from 2.3. Create and format: BCWS, BCWP, ACWP, CV, SV, CPI, SPI, CV %, SV %, Planned Obligation, Actual Obligation, Obligation Rate, Expenditure Rate, Milestone Count, Late Milestones, Avg Slip Days (milestones), Open Risks, High Risks (score β‰₯ 15). Test each in a matrix by Portfolio β†’ Program, and spot-check two programs against your Phase 1 Excel numbers.

πŸ“¦ Mini-project: Measure vs. Column Kata

Implement "Milestone Status" two ways: (a) as a calculated column on fact_Milestones, (b) as measures counting each status. Write a paragraph on which belongs where (status as a slicer attribute = column; counts = measures). Then build "SlipBucket" (0, 1–30, 31–90, >90 days) as a column and use it in a bar chart.

🧠 Self-check quiz

Answer in your own words, then check. Grade yourself honestly; your score is saved.

Q2.4.1
When should you use a calculated column instead of a measure?
Write at least a few words to unlock.
Q2.4.2
What does CALCULATE do?
Write at least a few words to unlock.
Q2.4.3
Why is CPI = DIVIDE([BCWP],[ACWP]) correct at the portfolio total, while averaging each program's CPI is wrong?
Write at least a few words to unlock.
Q2.4.4
What is row context, and where does it exist?
Write at least a few words to unlock.