Quick answer
Store sales at a consistent grain—one row per order line—and sum a revenue amount that belongs to that line. Connect product, customer, and date dimensions through unique keys using active, one-to-many relationships. Keep order-level totals out of the line-level revenue measure, and reconcile both row counts and amounts after every merge.
In Power BI, model relationships propagate filters; they do not enforce source-data integrity. A relationship cannot repair duplicated revenue already loaded into your fact table. (learn.microsoft.com)
Scope: This guide is for analysts and BI developers building a Power BI Desktop Import model. It uses standard relationships and DAX, not preview-dependent features. You need order-line data, product and customer identifiers, and an agreed definition of sales revenue.
The example below is entirely synthetic. Its currency, prices, and totals demonstrate modeling behavior, not business results.
1. Define what one sales row represents
Before choosing columns or creating relationships, write a grain statement:
“Each row in FactSales represents one order line from one source system.”
An order with three lines therefore contributes three rows. A product appearing on many orders is expected to repeat in the fact table. A line appearing twice because the same export was loaded twice is not.
Use an identifier that matches the grain. For this example, (OrderID, LineNumber) uniquely identifies a line. In a multi-system model, include the source-system identifier if order numbers can overlap.
Next, define the amount being reported. This example uses:
LineRevenue = Quantity × UnitPrice − LineDiscountAmount
Here, LineDiscountAmount means the total discount for that line—not a per-unit discount. Tax and shipping are excluded, every line uses the same currency, and there are no cancellations or returns.
For a real model, document those decisions explicitly. Do not assume that an order-system “total” equals the sales measure finance wants. If you need multiple currencies, returns, or order-level discounts, agree on their treatment before aggregating them.
The fact/dimension distinction matters: facts record events and measures; dimensions describe the entities used to filter and group those events. Microsoft’s star-schema guidance also distinguishes dimensionality from the grain established by the fact’s key values.
2. Build a small dataset with known answers
Start with a dataset small enough to reconcile manually.
| OrderID | LineNumber | OrderDate | CustomerKey | ProductKey | Quantity | UnitPrice | LineDiscountAmount | LineRevenue |
|---|---|---|---|---|---|---|---|---|
| 1001 | 1 | 2026-01-05 | C1 | P1 | 2 | 30 | 0 | 60 |
| 1001 | 2 | 2026-01-05 | C1 | P2 | 1 | 40 | 0 | 40 |
| 1002 | 1 | 2026-01-05 | C2 | P1 | 1 | 30 | 0 | 30 |
| 1003 | 1 | 2026-01-06 | C1 | P2 | 1 | 40 | 0 | 40 |
| 1003 | 2 | 2026-01-06 | C1 | P3 | 1 | 50 | 0 | 50 |
All amounts are illustrative currency units.
The baseline is five lines, three orders, six units, and 220 revenue.
Record these additional expected results:
| Breakdown | Expected revenue |
|---|---|
| Order 1001 | 100 |
| Order 1002 | 30 |
| Order 1003 | 90 |
| Product P1 | 90 |
| Product P2 | 80 |
| Product P3 | 50 |
| Customer C1 | 190 |
| Customer C2 | 30 |
| January 5, 2026 | 130 |
| January 6, 2026 | 90 |
These checks test different parts of the model. Product totals exercise the product relationship; customer totals exercise the customer relationship; daily totals exercise the date relationship.
A correct grand total alone is not enough. The model must also allocate that total to the correct groups.
3. Give each dimension a unique relationship key
Build three dimensions around FactSales:
| Table | One row represents | Relationship key | Example attributes |
|---|---|---|---|
| DimProduct | One product | ProductKey | ProductName, Category |
| DimCustomer | One customer | CustomerKey | CustomerName, Region |
| DimDate | One calendar date | Date | Year, MonthNumber, YearMonth |
For this exercise, DimProduct contains P1, P2, and P3 once each. DimCustomer contains C1 and C2 once each.
The key on the “one” side must contain unique values. Repeating product keys in FactSales are normal; repeating them in the dimension’s relationship column are not. Loading duplicates into an established “one” side can cause a Power BI refresh to fail. (learn.microsoft.com)
Do not fix conflicting dimension records by blindly removing duplicates. If P2 has two different categories, decide which record is authoritative. If the records intentionally preserve product history, this simple one-row-per-product design is insufficient: you need a history-aware design and a key that identifies the appropriate version.
Microsoft warns that removing duplicate rows can discard information. Investigate the cause before choosing a remedy. (learn.microsoft.com)
Also check missing matches. Each sales product and customer key should resolve to its intended dimension record. Quarantine unresolved records or map them to a documented “Unknown” member; do not silently drop their revenue.

4. Use relationships for filtering and a complete date table
For the example, configure these relationships:
DimProduct[ProductKey]1 → *FactSales[ProductKey]DimCustomer[CustomerKey]1 → *FactSales[CustomerKey]DimDate[Date]1 → *FactSales[OrderDate]
Make them active and use Single cross-filter direction, from dimension to fact. This lets dimension selections filter the sales rows being summed. (learn.microsoft.com)
Do not turn on Both merely because a visual looks wrong. Microsoft recommends minimizing bidirectional relationships because they can hurt performance and produce confusing filtering behavior. First check the keys, active relationship, and fields used in the visual. (learn.microsoft.com)
Use a date table with one unique, nonblank date per row, no missing dates, and full years. For this exercise, create a calculated table:
DimDate =
CALENDAR(DATE(2026, 1, 1), DATE(2026, 12, 31))
CALENDAR returns a contiguous date range including both endpoints. Extend the range when your real data extends beyond 2026. (learn.microsoft.com)
Add the period attributes your reports need. If using classic DAX time intelligence, mark the table as a date table; Microsoft’s current guidance distinguishes this requirement from calendar-based time intelligence. (learn.microsoft.com)
If the source order date includes a timestamp, convert it to a date in Power Query before creating the relationship. Merely changing its display format to “Date” does not remove the time component used for matching. (learn.microsoft.com)
5. Recognize the joins that inflate revenue
A Power Query merge joins tables on matching columns and can expand the matching records. It is different from adding a semantic-model relationship, which propagates filters between loaded tables. (learn.microsoft.com)
Two mistakes become obvious in the synthetic example.
Mistake A: summing an order total repeated across lines
Suppose an order-header table contains:
| OrderID | OrderRevenue |
|---|---|
| 1001 | 100 |
| 1002 | 30 |
| 1003 | 90 |
Merging these headers into the five sales lines repeats 100 on both lines of order 1001 and 90 on both lines of order 1003.
Summing that repeated column produces:
100 + 100 + 30 + 90 + 90 = 410
The row count remains five, but the amount is wrong. This is a grain mismatch, not necessarily a row-multiplication problem.
Sum line revenue instead. Keep order-level amounts in an order-grain table, or allocate them to lines using a documented rule that preserves each order’s original total.
Mistake B: expanding a dimension with duplicate keys
Suppose the product lookup contains two records for P2. A merge expanded against that lookup creates two copies of each P2 sales line.
The result becomes seven rows instead of five. P2’s 80 revenue appears twice, so total revenue becomes:
220 + 80 = 300
This calculation illustrates the consequence of expanding multiple matching lookup records. Check the lookup’s uniqueness before merging, then compare the expanded result with the baseline. (learn.microsoft.com)
Do not treat a many-to-many relationship as a shortcut around a dirty dimension. Correct the key or design a legitimate bridge for a genuinely many-to-many business relationship.
6. Implement the model in a controlled sequence
Use this sequence rather than importing everything and trusting automatic detection:
- Record the grain and revenue definition. Include the source, currency, discount treatment, and exclusions.
- Prepare FactSales in Power Query. Set explicit types and calculate line revenue. For this dataset, confirm five unique
(OrderID, LineNumber)combinations. - Prepare dimensions separately. Check unique relationship keys, conflicting attributes, and missing matches.
- Audit necessary merges. A line-to-unique-lookup merge should not increase the sales row count. Recalculate both row count and revenue after expansion.
- Load the tables and inspect relationships. In Power BI Desktop, use Modeling → Manage relationships to create or edit them. Verify cardinality, direction, and active status rather than accepting autodetected settings without review. (learn.microsoft.com)
- Create explicit measures and validate visuals. Use dimension attributes for grouping and measures for values.
For the example:
Revenue = SUM(FactSales[LineRevenue])
Orders = DISTINCTCOUNT(FactSales[OrderID])
Units = SUM(FactSales[Quantity])
SUM adds a numeric column; DISTINCTCOUNT counts distinct column values. If order identifiers are not globally unique, create a globally unique order key before using the order-count measure. (learn.microsoft.com)
Hide technical keys and any repeated header amounts from normal report-authoring use. This is a usability precaution, not a repair for incorrect data.
7. Reconcile totals, subtotals, and refreshes
Create a validation page before building the management dashboard:
- Revenue card: 220
- Orders card: 3
- Units card: 6
- Revenue by product: 90, 80, 50
- Revenue by customer: 190, 30
- Revenue by date: 130, 90
Then filter P2. Revenue should be 80, units 2, and orders 2. Filter customer C1 and January 6 together; revenue should be 90.
Do not expect distinct order counts to add across products. Order 1001 contains P1 and P2, while order 1003 contains P2 and P3. Product-level order counts are therefore 2, 2, and 1, but the grand total is still 3. Microsoft documents that distinct-count totals are non-additive. (learn.microsoft.com)
For production, compare source extracts and model results over the same date range, status filters, currency treatment, and refresh cutoff. Record differences explicitly rather than assuming every mismatch is duplication.
After each refresh, check:
- Fact-line uniqueness
- Dimension-key uniqueness
- Unmatched dimension keys
- Row counts before and after expanded merges
- Revenue against the agreed source control total
- Selected customer, product, and date subtotals
Release criterion: the model should preserve each valid sales line once, calculate revenue at that grain, and reproduce agreed totals under meaningful filters—not merely display a plausible headline number.