Dashboard βΊ Phase 2: Power BI
M2.3
Data Modeling and the Star Schema
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
- Facts = events and measurements (EVM by period, obligations by month, milestone records, task records). Dimensions = things you filter by (Program, Date, Contract, WBS, Appropriation, Vendor).
- Grain: State the grain of each fact, e.g., "one row per program Γ control account Γ month". Mixed grain causes double counting.
- Relationships: One-to-many, from dimension to fact. Single-direction filtering by default. Avoid bi-directional unless you know why you need it.
- Date table: One continuous date table, marked as the Date Table, related to every fact's date column. This fixes the "timeline only filters one table" problem from Module 1.5.
- Role-playing dates: Milestones have Baseline, Forecast, and Actual dates. Options: one active relationship plus inactive ones activated with
USERELATIONSHIPin DAX, or separate date tables per role. - Snowflake vs. star: Flatten small lookup chains (Portfolio β Program) into one dimension.
- Hygiene: Hide foreign keys in facts, set default summarization to "Don't summarize" for IDs, sort MonthName by MonthNum, use display folders, add descriptions.
Target model for PEO-FS:
dim_Date
β
dim_Program ββ fact_EVM ββ dim_WBS
β β²
β fact_Budget ββ dim_Appropriation
β
βββ fact_Milestones (BaselineDate active, ForecastDate/ActualDate inactive β dim_Date)
βββ fact_Tasks
βββ fact_Risks
βββ dim_Contract ββ (relates to fact_EVM by ContractNumber)
π Hands-on exercise: Build the PEO-FS Star
β¬ Practice data for this module
Data: all D1βD7 datasets plus dim_Date from 2.2.
- Create
dim_Appropriation(RDT&E, Procurement, O&M) anddim_WBS(distinct ProgramID+WBS with a composite keyProgramWBSKey) in Power Query. - Create relationships as in the diagram. Mark
dim_Dateas the date table. - Relate
fact_Milestones[BaselineDate](active) and[ForecastDate],[ActualDate](inactive) todim_Date[Date]. - Hide all FK columns in fact tables. Sort
MonthNamebyMonthNumandFYLabelbyFiscalYear. - Test: one matrix with dim_Program[Portfolio] and dim_Date[FYLabel] showing sums from fact_EVM and fact_Budget. Both should filter correctly.
π¦ Mini-project: Model Design Document
A 1β2 page model doc: diagram (screenshot), grain statement for each fact, relationship list (from/to, cardinality, direction, active?), and the reasoning for any inactive or bi-directional relationship. This becomes documentation for your capstone.
π§ Self-check quiz
Answer in your own words, then check. Grade yourself honestly; your score is saved.
Q2.3.1
What is the grain of
fact_EVM in PEO-FS?Write at least a few words to unlock.
Model answer
How did you do?
Q2.3.2
Why should filters flow from dimensions to facts and not the other way around?
Write at least a few words to unlock.
Model answer
How did you do?
Q2.3.3
A milestone table has three date columns. How can one date table filter all three?
Write at least a few words to unlock.
Model answer
How did you do?
USERELATIONSHIP. Or create separate role-playing date tables.Q2.3.4
Why mark a table as a Date Table?
Write at least a few words to unlock.
Model answer
How did you do?