M5 · Modeling · about 20 min
Scheduled vs Played
mediumRained-out games were replayed later, sometimes in the next month. The schedule review wants runs by the date each game was originally scheduled. Games has both dates and both are related to the Date table, but every version of the report still shows runs by the date played: Lakeside Lynx's game scheduled for 28 April 2025 keeps showing up in May.
Your task
Create a measure named [Runs by Scheduled Date]: total runs, placed on each game's Games[ScheduledDate] when sliced by the Date table. Keep Games[Date] as the active relationship, so every other measure still uses the date played.
What the grader checks
You see the situations, not the expected numbers. The expected values are computed live from your file and the source data.
- T1By month, both seasons
Year and Month from the Date table, all teams. Six games moved into another month. - T2Harbor Hawks, 2024 by month
Harbor Hawks, Year slicer 2024. One game was scheduled for 29 April and played on 2 May. - T3April 2025 by team
Year 2025 and Month April from the Date table, one row per team. - C1The played date stays the active relationship
Games[Date] to 'Date'[Date] is active, so other measures still use the date played.
Stuck?
Open one hint at a time.
Hint 1
There are two lines from Games to Date in Model view, one solid and one dashed. Which one does a filter on the Date table travel along?
Hint 2
Only one relationship between two tables can be active. A measure can switch to the inactive one for its own calculation, without changing the model.
Hint 3 (near-answer)
CALCULATE( SUM( Batting[Runs] ), USERELATIONSHIP( Games[ScheduledDate], 'Date'[Date] ) ).
Show the editorial
Solve it first if you can: the editorial gives the answer away.
The trap
Between two tables only one relationship can be active, and here it is Games[Date]. A plain SUM always follows it, so runs land on the date played. Filtering ScheduledDate with TREATAS doesn't switch paths: the Date table still filters Games[Date] too, so only games played and scheduled in the same month survive. Making the scheduled relationship active works for this measure but silently moves every other measure onto the scheduled date.
The fix
CALCULATE( SUM( Batting[Runs] ), USERELATIONSHIP( Games[ScheduledDate], 'Date'[Date] ) ).
Why it works
USERELATIONSHIP turns the inactive relationship on for the duration of this CALCULATE, and the active one off, so the Date table filters Games through ScheduledDate only. The model stays as it is: every other measure keeps using the date played.
Keep the most common date relationship active; reach the others per measure with USERELATIONSHIP.