Let’s Get Certified
Module 05 / 12 · Model the data

Model ordered and shipped sales against a shared calendar

Sales has separate order and ship dates.

Model ordered and shipped sales against a shared calendar

Sales has separate order and ship dates. A calendar slicer normally answers when the order was placed, but logistics wants to see when it shipped. Draw both relationships and test a sale whose dates fall in different months.

The recording uses an inactive relationship for ship date and activates it inside the relevant measure.

Work through the decision

Order A for 80 was booked on May 30 and shipped on June 2. A second order for 20 was booked and shipped June 3. What should June show?

Check your reasoning

June booked sales are 20 and June shipped sales are 100. Use the same amount measure under each date path. Equal dates on every test order would hide an incorrect relationship.

PL-300 recording · 36:53

Decisions and tradeoffs

USERELATIONSHIP inside CALCULATE
A measure can activate an existing inactive relationship during its evaluation while the default date path serves ordinary measures.
One-to-many, single direction
A dimension with unique keys normally filters many fact rows. Extra paths or bidirectional filtering need a specific reason.
Dedicated date table
Use a complete, unique calendar covering the analysis period for consistent time filtering and date intelligence.
Role-playing date dimensions
Separate date roles can support independent slicers for order and delivery periods at the same time.
Numeric sort-by column
Sort a display label by its corresponding ordinal when the label’s lexical order is unsuitable.

Check a transaction that crosses month end

Assume Calendar[Date] actively filters Orders[OrderDate] and also has an inactive relationship with Orders[ShipDate].

Booked amount = SUM(Orders[Amount])

Shipped amount =
    CALCULATE(
        [Booked amount],
        USERELATIONSHIP(Orders[ShipDate], 'Calendar'[Date])
    )

Put calendar month and both measures in a matrix. For the two transactions in the worked case, the May row should show a booking of 80, and June should show shipments of 100. Verify the one side of each relationship is unique.

Practice each guide skill

Work through these exercises in the order of the published guide. The checklist numbers are local references.

  1. Set display format, default summarization and sort column. Confirm a numeric account ID stays an identifier in a visual.
  2. Compare activating a second date relationship in a measure with using two date dimensions for independent slicers.
  3. Prove uniqueness on the one side and trace a single-direction filter before enabling any bidirectional path.
  4. Build a continuous calendar covering both order and shipping periods, then define its fiscal attributes.
  5. Choose a stored row-level category or a calculated table for materialized model data. Use a measure when the answer depends on current selections.

Official objectives for this lesson

Related lesson · Model shared ownership and reusable calculations

Knowledge check

Model ordered and shipped sales against a shared calendar quiz

Answer 3 questions. Check each answer for an explanation.