Data Modeling

Inactive Relationships and Calculation Groups

One invoice has three dates. One formula can serve every measure. Two model features that remove a lot of repeated work, shown on the H Mart model.

One sale, three dates

A shop orders in March, you promise delivery by April, and the goods arrive in April. Which month did the sale belong to? FactSales links to DateTable three times, but only one relationship can be active at a time. OrderDate is active. The other two wait until a measure calls them.

MonthNet sales

The same total moves between months, and April 2026 appears only by delivery or promise. This matters for cut-off testing, because revenue is often recognised on delivery while orders are counted on booking.

One formula, every measure

Without a calculation group, MTD, QTD and FYTD for 126 measures would need hundreds of near-identical measures. A calculation group keeps one copy of each time logic. SELECTEDMEASURE() stands for whichever measure is on the visual.

On 31-03-2026Net salesContribution margin

Two different measures, one formula. These are the model’s real results.

To try it, open the H Mart PBIX, put Time Intelligence[Time Calculation] on a slicer, and pick an item. Use calculation groups for repeated patterns, and an ordinary measure for logic that belongs to one measure only.

What about many-to-many?

H Mart does not need one, but you will meet it. If one invoice can have many salespersons and one salesperson many invoices, neither table has a unique key. The usual fix is a bridge table holding each valid pair, so filters pass through it from one side to the other. Power BI also offers a direct many-to-many relationship. Test the totals either way, because repeated matches can make a total look wrong even when each row is right.