One wide spreadsheet works until it does not: every column repeats, filters get ambiguous and DAX starts returning numbers that are wrong in ways nobody notices. A star schema — one fact table surrounded by small dimension tables — fixes the structure once, and every visual and measure inherits the fix.
| FactSales | many |
| DimDate | 1 → many |
| DimProduct | 1 → many |
| DimCustomer | 1 → many |
| DimRegion | 1 → many |
With everything in one table, a slicer on "Category" filters rows of sales. When the same category name appears with different casing or trailing spaces, the filter splits it into two and the total looks short.
Product name, category and price repeat on every sales row. A 2 million row export can carry 1.9 million duplicated text strings — file size grows, refresh slows, and one rename becomes a full reload.
Time intelligence needs a table of dates, not a date column. Ratios need a clean "one row per order". Neither exists in a flat export, so the measures get complicated instead of the model getting correct.
The grain is what one row means: one order line, one invoice line, one day per product. Write it down in a sentence before touching Power Query, because every later decision depends on it. A fact table at order-line grain can always be aggregated up; a fact table that mixes grains cannot be fixed later without rebuilding.
Keep the fact table narrow. It should contain the foreign keys (DateKey, ProductKey, CustomerKey, RegionKey) and the numeric measures (Quantity, UnitPrice, Discount, Amount). Remove descriptions, categories and names — they belong in dimensions.
FactSales DateKey (int, YYYYMMDD) ProductKey (int) CustomerKey (int) RegionKey (int) Quantity (int) Amount (decimal)
In Power Query, this is a "Reference" of the source query with the descriptive columns removed, not a second import of the same file.
Each dimension gets a single-column key, unique per row, and the attributes users filter by. Four dimensions cover most sales models: product, customer, region and date.
DimProduct ProductKey (int, unique) ProductName Category Subcategory DimRegion RegionKey (int, unique) Country Region City
Deduplicate inside Power Query: select the key column and use Remove Duplicates, or group by the key and keep the latest attribute row. A dimension with duplicate keys makes the relationship many-to-many and silently breaks filters.
Do not use the date column in the fact table. Create a separate table with one row per day, no gaps, covering every date in the data plus the full current year.
DimDate =
ADDCOLUMNS(
CALENDAR( DATE( 2022, 1, 1 ), DATE( 2026, 12, 31 ) ),
"Year", YEAR( [Date] ),
"MonthNumber", MONTH( [Date] ),
"Month", FORMAT( [Date], "mmm" ),
"Quarter", "Q" & QUARTER( [Date] )
)
Then right-click the table in the model view and choose Mark as date table, pointing at the Date column. Without that step, SAMEPERIODLASTYEAR and friends either fail or return blanks. Sort the Month column by MonthNumber so charts read January to December rather than alphabetically.
Drag each dimension key onto the matching fact key. Power BI should detect one-to-many with the dimension on the one side and the fact on the many side. Confirm the cross filter direction is Single, then hide the key columns from report view so nobody builds a visual on a number.
If Power BI proposes many-to-many, the dimension has duplicate keys. Fix the data, do not accept the relationship.
| Mistake | Symptom | Fix |
|---|---|---|
| Many-to-many accepted "because it works" | Totals double or drift as data grows | Deduplicate the dimension key, rebuild the relationship |
| Bidirectional filter left on by default | Filters leak between facts; performance collapses on large models | Keep single direction; use CROSSFILTER in one measure if a specific case needs it |
| Date column in the fact table instead of a date table | SAMEPERIODLASTYEAR returns blank or wrong values | Create DimDate, mark it, relate it, use its columns in visuals |
| Keys hidden but not removed from visuals | Users drag a key into a chart and get meaningless rows | Hide keys in report view; keep only attributes visible |
For a single table under a few thousand rows and one page of visuals, a flat table is fine. The moment you need a slicer to filter two different facts, time intelligence, or a second data source, the schema pays for itself.
Yes, and it is normal: sales and budget are separate facts. Each gets its own relationships to the shared dimensions. Do not merge them into one table with a "type" column unless the grain truly matches.
Usually no. Star schemas are faster and simpler to navigate. Flatten product category and subcategory into DimProduct rather than creating a separate category table, unless the category table has attributes you genuinely need at that level.
Compare a card with SUM(FactSales[Amount]) against the same total computed in Excel or SQL. Then slice by each dimension: the sum of every slice must equal the total. Any mismatch points to a relationship or duplicate key.
Substantially. Simple SUM and CALCULATE measures become correct because the filter context is unambiguous. See the six measures that cover most reports for the practical side.
Sales, orders, average order value, year over year, share of total and running total, with copy-ready code.
The templates already use this structure: one fact, small dimensions, a marked date table and measures on top.