Streak 0 daysPoints 0

Lesson29/59
Inactive relationships

Sales by ship date with USERELATIONSHIP

New functionsCALCULATE, USERELATIONSHIP
StatusNot started

Sales has two dates: Order Date and Ship Date. Both relate to Date[Date], but only one relationship can be active, here the order date. The ship date relationship exists but is inactive (a dashed line in Power BI).

CALCULATE([Sales Amount], USERELATIONSHIP(Sales[Ship Date], Date[Date])) switches to it for one calculation. Orders placed in late December and shipped in January move to the next month.

Your task

Write Shipped Sales: the Sales Amount by ship date instead of order date.

*1*1*1*1SALEST1 · 420 ROWSSalesKeyNUMOrder DateDATEShip DateDATEProductKeyNUMCustomerKeyNUMQuantityNUMUnit PriceNUMPRODUCTT2 · 8 ROWSProductKeyNUMProductTEXTCategoryTEXTColorTEXTList PriceNUMStandard CostNUMCUSTOMERT3 · 10 ROWSCustomerKeyNUMCustomerTEXTCountryTEXTSegmentTEXTDATET4 · 731 ROWSDateDATEYearNUMQuarterTEXTMonthTEXTMonth NumberNUMNOTES1Filters flow from 1 to *, alongthe arrow: Product filters Sales.2Select a column or a measureto insert it at the cursor.3Measures in this model:[Sales Amount]Key columnFact tableSALES MODEL · STAR SCHEMASHEET 1 OF 1

About this exercise

You practise inactive relationships with CALCULATE and USERELATIONSHIP. The exercise runs on a small bike-shop model with a Sales fact table and Product, Customer and Date dimensions, the same star schema in every lesson.

Your measure, Shipped Sales, fills a Power BI-style matrix grouped by Date[Year] and Date[Quarter]. As in a real report, each cell evaluates the measure in its own filter context, and the subtotals and the grand total are evaluated again in theirs rather than added up. When you check your answer, every cell is compared with the expected value, wrong cells are marked, and the hint is about the mistake you made.

Measures that already exist in the model: Sales Amount. Reference them in square brackets, for example [Sales Amount].

Where you start

Shipped Sales =

The result to build

Expected result for Shipped Sales
Year › QuarterShipped Sales
2024127,247.15
Q124,834.05
Q238,651.30
Q331,576.80
Q432,185.00
2025129,923.10
Q134,661.20
Q225,565.80
Q329,526.20
Q440,169.90
Total257,394.45

Last updated 10 November 2026

Opening the exercise…