Goals at home
CALCULATE & Filter Context · Intermediate · Chapter 8 of 10. The most important function in DAX, step by step.
The request, from Rhys Abara, Analyst, Northfield League: "Pundits keep talking about home advantage. How many of each team's goals came at home?" A measure named Home Goals.
New dataset! The Northfield League has ten teams and two seasons. Results has one row per team per match, with Venue (Home or Away), goals and points. CALCULATE evaluates a measure with an extra filter: here, only the home games.
Task: Create Home Goals = CALCULATE([Goals], Results[Venue] = "Home").
Task: The table shows it next to all goals, per team.
Practice data: Northfield League, a fictional football league with clubs, matches and goals. The model has the Results and Team tables.
DAX functions used: CALCULATE.
How it works: the exercise opens a practice copy of the Power BI report editor in your browser. Do the task, press Check, and your result is compared with the expected answer in seconds. Hints are there if you get stuck.