Power BI Exercises

Home points that respect the rows

CALCULATE & Filter Context · Advanced · Chapter 8 of 10. The most important function in DAX, step by step.

The request, from Rhys Abara, Analyst, Northfield League: "Home points by venue keep showing up on the Away row too. Make it behave." A measure named Home Points that respects the Venue filter.

A filter inside CALCULATE normally replaces the existing filter on that column. With Venue on the rows, CALCULATE([Total Points], Results[Venue] = "Home") would show home points on the Away row too. KEEPFILTERS intersects instead: the Away row becomes blank.

Task: Create Home Points = CALCULATE([Total Points], KEEPFILTERS(Results[Venue] = "Home")).

Task: In the table by Venue, only the Home row has a value.

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, KEEPFILTERS.

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.

Keep practicing