Picture this. You import one wide "everything" table from a SQL view. It has orders, products, customers, dates, and freight, all in one place. The report works, until it doesn't. The file is bigger than you expected, refresh feels slow, and then someone notices that total freight is three times what finance reports. Every order line carried a copy of the order's freight, and your SUM added them all up.
Now you wonder whether the star schema everyone keeps recommending is worth the effort. This article answers that honestly. We will look at how the Power BI star schema and the flat table (also called one big table, or denormalization) behave inside VertiPaq, where each one helps, and where each one hurts. I will not give you a magic speed multiplier, because it would be made up. Results depend on your data, your column cardinality, and your queries. What you will get is a way to reason about the trade-off and a way to measure it yourself.
The Sample Data Model Used in This Article
Every example uses the same model, so you can compare designs without re-learning the tables.
- Customer (dimension): CustomerKey, CustomerID, CustomerName, Gender, BirthDate, Segment, City, State, Country, Region, JoinDate.
- Product (dimension): ProductKey, ProductID, ProductName, Category, Subcategory, Brand, Color, Size, UnitCost, ListPrice, LaunchDate.
- Date (dimension): one row per day, no gaps, marked as the date table on [Date].
- Sales (fact, order header): one row per order, with CustomerKey, OrderDate (active), ShipDate (inactive), SalesChannel, PaymentMethod, Freight, TaxAmount.
- Sales Order Details (fact, order lines): one row per product per order, with SalesOrderID, ProductKey, Quantity, UnitPrice, DiscountPct, SalesAmount, TotalCost.
All relationships are one-to-many and single direction: Customer to Sales, Date to Sales on OrderDate (active), Date to Sales on ShipDate (inactive), Sales to Sales Order Details, and Product to Sales Order Details. Customer and Date filters flow through Sales into Sales Order Details. Product filters reach only Sales Order Details. Header-level amounts (Freight, TaxAmount) are not filtered by Product, and we will keep coming back to that.
These are the base measures, defined once and reused throughout:
Total Sales = SUM ( 'Sales Order Details'[SalesAmount] )
Total Cost = SUM ( 'Sales Order Details'[TotalCost] )
Total Profit = [Total Sales] - [Total Cost]
Profit Margin % = DIVIDE ( [Total Profit], [Total Sales] )
Total Quantity = SUM ( 'Sales Order Details'[Quantity] )
Order Count = DISTINCTCOUNT ( Sales[SalesOrderID] )
Total Freight = SUM ( Sales[Freight] )
Sales by Ship Date =
CALCULATE (
[Total Sales],
USERELATIONSHIP ( 'Date'[Date], Sales[ShipDate] )
)
Average Order Value = DIVIDE ( [Total Sales], [Order Count] )
Sales All Products = CALCULATE ( [Total Sales], REMOVEFILTERS ( Product ) )
% of All Products = DIVIDE ( [Total Sales], [Sales All Products] )
Sales Previous Year = CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
Sales YTD = CALCULATE ( [Total Sales], DATESYTD ( 'Date'[Date] ) )
Sales Fiscal YTD = CALCULATE ( [Total Sales], DATESYTD ( 'Date'[Date], "6-30" ) )
Core Concepts, Explained Simply
Star Schema vs Flat Table
A star schema puts measurable events (facts) in the middle and descriptions (dimensions) around them, joined by one-to-many relationships. Think of a library catalogue. A book card points to an author card, and the author's biography is written once. In our model, Sales and Sales Order Details are the facts, and Customer, Product, and Date are the dimensions.
A flat table (one big table) joins everything upfront into a single wide table. It is like a spreadsheet where every row restates the author's biography. It is simple to look at, but the same descriptive text appears on every row.
What VertiPaq Is
VertiPaq is the in-memory, column-oriented storage engine behind Power BI (Import mode) and SSAS Tabular. "Column-oriented" means each column is stored and compressed separately, like a filing cabinet with one drawer per column. That suits analytics, where a query usually touches a few columns, not entire rows.
Two compression ideas matter here, and I will stay at the level I am sure about. Dictionary encoding stores each distinct value of a column once in a dictionary, and the rows hold compact references to it. It works like a phone contact list: you save a name once and refer to it by entry. Run-length encoding stores a repeated value as "this value, this many times in a row", which helps when consecutive rows repeat. Data is also split into segments. I will not quote segment sizes or thresholds, so check the current documentation for those.
Column Cardinality
Cardinality is the number of distinct values in a column. It is the main driver of column size. A column such as Segment has three values, so its dictionary is tiny. A column such as an order ID, a timestamp, or free text has many distinct values, so its dictionary is large and it compresses poorly. That is why high-cardinality columns are expensive, and why unused ones are the first thing to remove.
Storage Engine vs Formula Engine
In simple terms, the storage engine scans and aggregates the compressed data, and it can work in parallel. The formula engine evaluates the DAX logic, such as iterators and complex expressions, and generally works single-threaded. Model shape affects both. It changes what the storage engine must scan, and it changes how much logic the formula engine must write to get the right answer.
Grain
Grain is the level of detail of a table. Sales has one row per order. Sales Order Details has one row per product per order. When you join them into one flat table, the grain becomes one row per order line, and every order-level value (Freight, TaxAmount) is repeated on each line. That repetition is the root of the inflated-freight story from the introduction.
How Each Design Behaves in VertiPaq
Where Repeated Text Lives
In a star schema, CustomerName, Segment, ProductName, and Category sit once per dimension row. In a flat table, those columns exist on every line row. Dictionary encoding still stores each distinct value once, so a low-cardinality column like Category may compress well even when repeated. A high-cardinality column like CustomerName repeated across a huge number of lines can still be costly. The outcome depends on your data.
Relationship Cost vs Wide-Table Scan
A star schema adds relationships, and filtering through them has a cost. A flat table avoids relationships but has more, wider columns on the large table. Neither is always smaller or faster. It depends on the data, the cardinality of the columns, and the queries you run. Measure your own model instead of trusting a rule.
Filter Propagation
In a star schema, a dimension filter travels through a relationship to the fact table. In a flat table, every filter is a plain column filter on the same table. The flat version is conceptually simpler. The star version lets one dimension filter several fact tables.
Date Handling
A dedicated, marked 'Date' table has unique, contiguous dates. It is the supported foundation for time intelligence functions such as SAMEPERIODLASTYEAR and DATESYTD. It also supports the role-playing pattern, where OrderDate is active and ShipDate is activated with USERELATIONSHIP. A fact column of raw dates has repeated dates and only the days that had sales, so it lacks those guarantees. I would not rely on time intelligence over such a column without testing it. Examples 11 to 14 explore this.
Header-Level Amounts
In a flat table, Freight and TaxAmount repeat on every line of an order, so SUM overcounts. In the star schema they stay on Sales, one row per order, so the sum is correct.
Maintainability and Reuse
Conformed dimensions give you one place to fix a product name and consistent slicers across several fact tables. In a flat table, the fix must flow through every row, and each additional fact table would need its own copy of the descriptive columns.
Auto Date/Time
When the auto date/time option is enabled, Power BI creates hidden date tables for date columns. Their exact behavior and defaults have changed over time, so check the current documentation and your own settings. With a proper Date table, many authors turn this option off.
How to Measure It
- VertiPaq Analyzer (available through DAX Studio and Tabular Editor) reports storage statistics for your model. Typically that means sizes per table, column, dictionary, and relationship, plus column cardinality. You can usually save the results to compare before and after a change.
- DAX Studio Server Timings separates a query's time into storage engine and formula engine work, and shows the storage engine queries that were sent.
- Power BI Performance Analyzer records how long each visual takes to refresh, and lets you copy the DAX query behind a visual.
- The DAX query view in Power BI Desktop lets you run
EVALUATEqueries, which is ideal for validating totals between designs.
A simple method: build both designs from the same source, compare total model size and the size of the biggest columns, run the same visuals' queries on both, and compare timings (clear the cache between runs so they are comparable). Finally, reconcile the totals.
Star Schema vs Flat Table: Comparison
| Aspect | Star schema | Flat table |
|---|---|---|
| Model structure | Two fact tables with Customer, Product, and Date dimensions | One table at order-line grain |
| Data duplication | Descriptive attributes stored once per dimension row | Attributes repeated on every line row |
| Expected storage behavior | Smaller descriptive columns, plus relationship structures; depends on the data | Wider large table; low-cardinality text may compress well; depends on the data |
| Relationships | Five one-to-many relationships | None needed within the table itself |
| Grain | Each table has one clear grain | One grain; header-level values repeat on each line |
| Time intelligence | Marked Date table; role-playing dates with USERELATIONSHIP | Raw date columns; test carefully, or add a Date table |
| Header-level amounts | Freight and TaxAmount live on Sales; sums are correct | Repeated per line; a plain SUM overcounts |
| Maintainability | Fix an attribute once in its dimension | Fix flows through the wide table; no sharing across facts |
| Refresh and ETL effort | Several tables with clean keys | Join work moves upstream into one query |
| Report author experience | Fields grouped by table | One long field list |
| Typical fit | Shared, growing, multi-fact models | Small, single-grain, quick analysis |
| Main limitation | Needs design effort and clean keys | Mixed grain and no reuse |
Pros, Cons, and Limitations
Star Schema
- Pros: descriptions stored once, correct header-level amounts, reusable dimensions, a proper Date table, clear grain per table.
- Cons: more design and key-cleaning work, more tables for authors to learn.
- Limitations: filters do not cross every relationship, so header-level measures by Product can mislead. Performance depends on the model and the query.
Flat Table
- Pros: simple to build, no relationships to manage, easy for small one-off work.
- Cons: mixed grain, repeated attributes, header amounts overcount, harder to reuse across facts.
- Limitations: time intelligence needs care, and size or speed benefits are not guaranteed. They depend on the model and the query.
Which One Should You Use?
- A flat table is acceptable when the data is small, there is one fact grain, the model is a one-off, and no one needs header-level amounts or shared dimensions.
- Use a star schema when you have more than one fact table, header-level amounts, a need for time intelligence, or a model that others will extend.
- Consider a hybrid when a few descriptive columns are denormalized on purpose, or you need a snowflake (a dimension linked to another dimension) or a narrow aggregation table. Test any hybrid against your own model.
Rule of thumb: one grain per table, facts in the middle, descriptions around them.
20 Examples on the Sample Data Model
The Hypothetical 'Sales Flat' Table
The Sample Data Model has no flat table, so I am adding one hypothetical table, 'Sales Flat'. It has one row per order line, with the columns of Sales Order Details (SalesOrderLineID, SalesOrderID, ProductKey, Quantity, UnitPrice, DiscountPct, SalesAmount, TotalCost) plus these denormalized columns: OrderDate, ShipDate, CustomerName, Segment, Country, ProductName, Category, Subcategory, SalesChannel, Freight, TaxAmount. It has no relationships to other tables. Flat-table measures are declared in the example where they first appear, and I assume they exist in the model afterward.
Beginner
Example 01: The Same Question in Both Designs
Type: two DAX queries (EVALUATE). No new measures.
EVALUATE
DISTINCT ( Product[Category] )
ORDER BY Product[Category]
EVALUATE
DISTINCT ( 'Sales Flat'[Category] )
ORDER BY 'Sales Flat'[Category]
Run each query separately in the DAX query view or DAX Studio. Both list the product categories, so both designs can answer the same question. The star query reads the small Product dimension. The flat query reads a column of the large table. The lesson: the Product dimension may list categories that have never sold, while 'Sales Flat' can only list categories that appear on a line. Compare the two results.
Example 02: Total Sales by Category (Star Schema)
Type: DAX query. Uses [Total Sales].
EVALUATE
SUMMARIZECOLUMNS (
Product[Category],
"Total Sales", [Total Sales]
)
ORDER BY Product[Category]
Product[Category] filters Sales Order Details through the Product relationship, and SUM adds SalesAmount for each category. SUMMARIZECOLUMNS groups by the column and evaluates the measure for each group. It also drops rows where every measure is blank. Keep this result as the reference for the next two examples.
Example 03: The Same Result on 'Sales Flat'
Type: new measure, then a DAX query. New measure: [Flat Total Sales].
Flat Total Sales = SUM ( 'Sales Flat'[SalesAmount] )
EVALUATE
ADDCOLUMNS (
VALUES ( Product[Category] ),
"Star Total Sales", [Total Sales],
"Flat Total Sales",
VAR CurrentCategory = Product[Category]
RETURN
CALCULATE (
[Flat Total Sales],
'Sales Flat'[Category] = CurrentCategory
)
)
ORDER BY Product[Category]
Because 'Sales Flat' has no relationship to Product, a Product filter cannot reach it. The query therefore captures the category in a variable and applies it as a column filter on the flat table. That is a neat demonstration of the filter-propagation difference. The two columns should match if the flat table was built correctly. If a category appears with a blank flat value, check for unmatched or differently spelled categories.
Example 04: Reconciling at the Grand Total
Type: DAX query. Uses [Total Sales] and [Flat Total Sales].
EVALUATE
ROW (
"Total Sales", [Total Sales],
"Flat Total Sales", [Flat Total Sales],
"Difference", [Total Sales] - [Flat Total Sales]
)
If the flat table was built correctly, the difference is zero. A non-zero difference points to dropped rows, for example from an inner join, or to duplicated rows from a join that multiplied lines. Reconcile the totals before comparing any performance numbers. A faster model that gives wrong totals is not an improvement.
Example 05: Column Cardinality
Type: DAX query. No new measures.
EVALUATE
ROW (
"Customer Rows", COUNTROWS ( Customer ),
"Distinct CustomerName", DISTINCTCOUNT ( Customer[CustomerName] ),
"Distinct Country", DISTINCTCOUNT ( Customer[Country] ),
"Distinct Segment", COUNTROWS ( VALUES ( Customer[Segment] ) ),
"Product Rows", COUNTROWS ( Product ),
"Distinct ProductName", DISTINCTCOUNT ( Product[ProductName] ),
"Distinct Category", COUNTROWS ( VALUES ( Product[Category] ) )
)
This shows how many distinct values each column holds. Segment and Category should be tiny, while names should be close to the row count. Low-cardinality columns tend to have small dictionaries, and high-cardinality ones tend to be expensive. Both counting approaches include the blank value if one exists. Use the result to decide which columns deserve attention.
Intermediate: Filter Context and Grain
Example 06: Freight by Country (Star Schema)
Type: DAX query. Uses [Total Freight].
EVALUATE
SUMMARIZECOLUMNS (
Customer[Country],
"Total Freight", [Total Freight]
)
ORDER BY Customer[Country]
Freight sits on Sales, with one row per order. Customer filters Sales directly, so each order's freight is counted exactly once. This is correct because the filter and the amount share the same grain. Slicing header-level amounts by Customer or Date is safe in this model.
Example 07: Freight Overcounts on 'Sales Flat'
Type: new measure, then a DAX query. New measure: [Flat Total Freight].
Flat Total Freight = SUM ( 'Sales Flat'[Freight] )
EVALUATE
TOPN (
10,
FILTER (
ADDCOLUMNS (
VALUES ( 'Sales Flat'[SalesOrderID] ),
"Line Count", CALCULATE ( COUNTROWS ( 'Sales Flat' ) ),
"Flat Freight", [Flat Total Freight],
"Header Freight",
VAR CurrentOrder = 'Sales Flat'[SalesOrderID]
RETURN
CALCULATE ( [Total Freight], Sales[SalesOrderID] = CurrentOrder )
),
[Line Count] > 1
),
[Flat Freight], DESC
)
For each multi-line order, the flat freight is the order's freight multiplied by its line count, while the header freight is correct. The table's grain is the order line, but Freight belongs to the order. Summing a column at the wrong grain duplicates the value. On a large model this query is heavy because it iterates every order, so test it on a small dataset.
Example 08: A Corrected Flat-Table Measure
Type: new measure. New measure: [Flat Total Freight Corrected]. It needs no new column.
Flat Total Freight Corrected =
SUMX (
VALUES ( 'Sales Flat'[SalesOrderID] ),
CALCULATE ( MAX ( 'Sales Flat'[Freight] ) )
)
The measure iterates each distinct order, takes the freight for that order, and adds it once. It relies on Freight being identical on every line of an order, which you should verify. It also iterates a high-cardinality column, so it may be slower on large data, and you should measure it. The better fix is to keep Freight on a header-grain table, as the star schema does.
Example 09: Freight by Category Is Misleading
Type: DAX query. Uses [Total Freight] and [Total Sales].
EVALUATE
SUMMARIZECOLUMNS (
Product[Category],
"Total Sales", [Total Sales],
"Total Freight", [Total Freight]
)
ORDER BY Product[Category]
Product filters flow only to Sales Order Details, and Freight lives on Sales, so the filter never reaches it. Expect every category to show the same overall freight, so adding up the column would multiply the real total. The model gives no error, which makes this easy to miss. Do not slice header-level amounts by Product columns, and treat any such visual as wrong unless you have allocated the amount deliberately.
Example 10: Order Count vs Distinct Orders on 'Sales Flat'
Type: new measures, then a DAX query. New measures: [Flat Order Count], [Orders With Lines].
Flat Order Count = DISTINCTCOUNT ( 'Sales Flat'[SalesOrderID] )
Orders With Lines = DISTINCTCOUNT ( 'Sales Order Details'[SalesOrderID] )
EVALUATE
SUMMARIZECOLUMNS (
Product[Category],
"Order Count", [Order Count],
"Orders With Lines", [Orders With Lines],
"Flat Order Count", [Flat Order Count]
)
ORDER BY Product[Category]
[Order Count] counts orders in Sales, which Product does not filter, so it repeats the same number for each category. [Orders With Lines] counts orders from the line table, and [Flat Order Count] counts orders found in the flat table. Those two should agree by category. At the grand total, [Order Count] can differ if some orders have no lines. The lesson: the same word, "orders", can mean different things depending on which table you count.
Intermediate: Time Intelligence and Relationships
Example 11: YTD and Previous Year (Star Schema)
Type: DAX query. Uses [Total Sales], [Sales YTD], [Sales Previous Year].
EVALUATE
SUMMARIZECOLUMNS (
'Date'[MonthYearSort],
'Date'[MonthYear],
"Total Sales", [Total Sales],
"Sales YTD", [Sales YTD],
"Sales Previous Year", [Sales Previous Year]
)
ORDER BY 'Date'[MonthYearSort]
The marked Date table has every day, so DATESYTD and SAMEPERIODLASTYEAR can shift whole periods reliably. Grouping by MonthYearSort first keeps months in chronological order. Months with no sales still exist in the Date table, though SUMMARIZECOLUMNS will hide rows where all three measures are blank. The result depends on your data's date range.
Example 12: The Same Pattern on 'Sales Flat'
Type: measure to test. New measure: [Flat Sales Previous Year Test].
Flat Sales Previous Year Test =
CALCULATE (
[Flat Total Sales],
SAMEPERIODLASTYEAR ( 'Sales Flat'[OrderDate] )
)
This is an experiment, not a recommendation. 'Sales Flat'[OrderDate] repeats dates and contains only the days with sales, so it lacks the unique, gap-free dates a marked Date table guarantees. I will not promise how it behaves. Put it in a visual by month and by day, compare it with example 11, and look for gaps. The dependable fix is to relate a proper Date table to the flat table, which makes it a hybrid design.
Example 13: Sales by Ship Date
Type: DAX query. Uses [Total Sales] and [Sales by Ship Date].
EVALUATE
SUMMARIZECOLUMNS (
'Date'[MonthYearSort],
'Date'[MonthYear],
"Sales by Order Date", [Total Sales],
"Sales by Ship Date", [Sales by Ship Date]
)
ORDER BY 'Date'[MonthYearSort]
Date has an active relationship to Sales[OrderDate] and an inactive one to Sales[ShipDate]. USERELATIONSHIP switches to the inactive one just for that measure. The same Date table therefore plays two roles, order date and ship date. 'Sales Flat' has both date columns, but without a Date table you can only group by the raw columns. To get the same behavior you would relate a Date table to it twice, which again means moving toward a star.
Example 14: Fiscal YTD with "6-30"
Type: DAX query. Uses [Total Sales] and [Sales Fiscal YTD].
EVALUATE
SUMMARIZECOLUMNS (
'Date'[FiscalYear],
'Date'[MonthYearSort],
'Date'[MonthYear],
"Total Sales", [Total Sales],
"Sales Fiscal YTD", [Sales Fiscal YTD]
)
ORDER BY 'Date'[MonthYearSort]
The second argument of DATESYTD is the year-end date, given as a text literal. "6-30" means the year ends on June 30, so the fiscal year starts on July 1. The year part is not needed, and the exact text format can depend on locale, so check the current documentation. Confirm that your Date[FiscalYear] column uses the same June year-end, or the two will disagree. The running total restarts on July 1 each year.
Advanced and Pitfalls in Practice
Example 15: Percent of All Products
Type: DAX queries and two new measures. New measures: [Flat Sales All Products], [Flat % of All Products].
EVALUATE
SUMMARIZECOLUMNS (
Product[Category],
"Total Sales", [Total Sales],
"% of All Products", [% of All Products]
)
ORDER BY Product[Category]
Flat Sales All Products =
CALCULATE (
[Flat Total Sales],
REMOVEFILTERS (
'Sales Flat'[Category],
'Sales Flat'[Subcategory],
'Sales Flat'[ProductName]
)
)
Flat % of All Products = DIVIDE ( [Flat Total Sales], [Flat Sales All Products] )
EVALUATE
SUMMARIZECOLUMNS (
'Sales Flat'[Category],
"Flat Total Sales", [Flat Total Sales],
"Flat % of All Products", [Flat % of All Products]
)
ORDER BY 'Sales Flat'[Category]
In the star schema, REMOVEFILTERS ( Product ) clears every product attribute in one go. In the flat table you must list each product column, and forgetting one leaves a filter behind. Removing filters from the whole 'Sales Flat' table would also clear customer and date filters, which is rarely what you want. Both versions should return the same percentages if the flat table is correct.
Example 16: Fact Rows with No Matching Dimension Row
Type: DAX query. No new measures.
EVALUATE
ROW (
"Lines With Unmatched Product",
COUNTROWS (
FILTER ( 'Sales Order Details', ISBLANK ( RELATED ( Product[ProductKey] ) ) )
) + 0,
"Sales On Unmatched Product",
SUMX (
FILTER ( 'Sales Order Details', ISBLANK ( RELATED ( Product[ProductKey] ) ) ),
'Sales Order Details'[SalesAmount]
),
"Orders With Unmatched Customer",
COUNTROWS (
FILTER ( Sales, ISBLANK ( RELATED ( Customer[CustomerKey] ) ) )
) + 0
)
RELATED returns blank when a fact row has no matching dimension row. When this happens, the model groups those rows under an extra blank row, the unknown member, in the dimension, and you see it as (Blank) in visuals. Adding zero turns an empty count into 0 instead of blank. A flat table hides this problem because the join already dropped or blanked those rows upstream. How many rows you find depends entirely on your data.
Example 17: A Small Denormalized Calculated Table
Type: calculated table. New table: 'Sales Extract Demo'.
Sales Extract Demo =
SELECTCOLUMNS (
'Sales Order Details',
"SalesOrderLineID", 'Sales Order Details'[SalesOrderLineID],
"SalesOrderID", 'Sales Order Details'[SalesOrderID],
"Category", RELATED ( Product[Category] ),
"Segment", RELATED ( Customer[Segment] ),
"SalesAmount", 'Sales Order Details'[SalesAmount]
)
The table follows the line-to-product and line-to-order-to-customer relationships to pull in two descriptive columns. It produces a small flat extract inside the model. A calculated table is stored in the model, so it adds to model size, and it is recalculated when the model refreshes. SalesOrderLineID is a high-cardinality column, so include it only if you need it. Treat the table as a demo or a targeted aggregation source, not a replacement for good modeling.
Example 18: Flattening with a SQL Join
Type: SQL fragment (illustrative source table names, adjust to your database).
SELECT
d.SalesOrderLineID, d.SalesOrderID, d.ProductKey,
d.Quantity, d.UnitPrice, d.DiscountPct, d.SalesAmount, d.TotalCost,
s.OrderDate, s.ShipDate, s.SalesChannel, s.Freight, s.TaxAmount,
c.CustomerName, c.Segment, c.Country,
p.ProductName, p.Category, p.Subcategory
FROM SalesOrderDetails AS d
LEFT JOIN Sales AS s ON s.SalesOrderID = d.SalesOrderID
LEFT JOIN Customer AS c ON c.CustomerKey = s.CustomerKey
LEFT JOIN Product AS p ON p.ProductKey = d.ProductKey;
This joins the line table to the order header, customer, and product, and returns one row per order line, the 'Sales Flat' grain. Order-level columns (Freight, TaxAmount, dates) are repeated on every line of the order. I used left joins from the lines so that unmatched keys remain visible instead of silently disappearing, which an inner join would do. Reconcile the row count and sales total against the source after building it.
Example 19: Average Order Value and Profit Margin on Both Designs
Type: new measures, then a DAX query. New measures: [Flat Total Cost], [Flat Total Profit], [Flat Profit Margin %], [Flat Average Order Value].
Flat Total Cost = SUM ( 'Sales Flat'[TotalCost] )
Flat Total Profit = [Flat Total Sales] - [Flat Total Cost]
Flat Profit Margin % = DIVIDE ( [Flat Total Profit], [Flat Total Sales] )
Flat Average Order Value = DIVIDE ( [Flat Total Sales], [Flat Order Count] )
EVALUATE
ROW (
"Average Order Value", [Average Order Value],
"Flat Average Order Value", [Flat Average Order Value],
"Profit Margin %", [Profit Margin %],
"Flat Profit Margin %", [Flat Profit Margin %]
)
Both pairs should reconcile when the flat table is built correctly and no orders are missing lines. The flat average order value divides by distinct orders, not by rows, which is the key choice. Dividing by COUNTROWS ( 'Sales Flat' ) would give an average line value instead. The pitfall appears when someone adds a header-level column such as Freight to a flat-table sum, since it is repeated on every line.
Example 20: One Validation Query for Both Designs
Type: DAX query with a query-scoped measure. New measure: [Flat Total Quantity] (defined inside the query).
DEFINE
MEASURE 'Sales Flat'[Flat Total Quantity] = SUM ( 'Sales Flat'[Quantity] )
EVALUATE
UNION (
ROW (
"Design", "Star schema",
"Sales", [Total Sales],
"Cost", [Total Cost],
"Quantity", [Total Quantity],
"Orders", [Order Count]
),
ROW (
"Design", "Flat table",
"Sales", [Flat Total Sales],
"Cost", [Flat Total Cost],
"Quantity", [Flat Total Quantity],
"Orders", [Flat Order Count]
)
)
The query returns one row per design with the same four totals, so you can compare them at a glance. Defining the quantity measure inside the query avoids changing the model just to validate it. Differences in Sales, Cost, or Quantity point to dropped or duplicated lines. A difference only in Orders may mean orders without lines. Run this after every rebuild of either design.
Common Pitfalls
- Summing header-level amounts on line rows. Freight and TaxAmount repeat on each line, so the total inflates. Detect it by comparing against the Sales table, as in example 07.
- Flattening and losing the Date table. Time intelligence may behave unexpectedly on raw date columns. Test with the DAX query view, and relate a proper Date table.
- Assuming a flat table is smaller or faster. It may or may not be. Compare VertiPaq Analyzer statistics and Server Timings on both designs.
- Keeping unused high-cardinality columns. IDs, timestamps, and free text can be costly. Look at the largest columns in VertiPaq Analyzer and remove the ones no report uses.
- Adding bi-directional or many-to-many relationships to "fix" a star. These change how filters propagate and can add ambiguity. Fix the grain or the keys first, and test any change. Behavior can depend on your Power BI version and the SSAS compatibility level.
- Unmatched keys creating a blank row. You see (Blank) in a dimension visual. Detect it with example 16.
- Trusting a model without reconciling. Always compare totals against the source, as in examples 04 and 20.
Best Practices Checklist
- Model at the lowest useful grain. You can always aggregate up, but you cannot recover detail you threw away.
- Keep descriptive attributes in dimensions. They are stored once and fixed in one place.
- Use one dedicated, marked Date table. Time intelligence depends on unique, contiguous dates.
- Keep header-level amounts on the header table. This prevents overcounting at the line grain.
- Remove unused and high-cardinality columns. They drive column size without adding value.
- Fix keys and data quality at the source. Unmatched keys create blank rows and quiet errors.
- Reuse base measures. One definition of [Total Sales] keeps every report consistent.
- Measure before and after changes. VertiPaq Analyzer and DAX Studio show what really changed.
- Validate totals between designs. A reconciliation query catches duplication and dropped rows early.
- Document model decisions. Future you will need to know why a column or relationship exists.
Quick Reference
| Situation | Recommended approach |
|---|---|
| Small, one-off analysis with one grain | A flat table can be acceptable; reconcile totals |
| Several fact tables sharing customers or products | Star schema with conformed dimensions |
| Freight or TaxAmount per order | Keep on the order header table |
| Year-to-date or previous-year comparisons | Marked Date table related to the fact |
| Order date and ship date both needed | One Date table with an inactive relationship and USERELATIONSHIP |
| Model feels large or slow | Measure with VertiPaq Analyzer and Server Timings first |
| (Blank) appears in a dimension visual | Find and fix unmatched keys |
Frequently Asked Questions
Is a flat table always bad in Power BI?
No. For a small model with a single grain and no header-level amounts, it can work well. It becomes risky when you mix grains, need time intelligence, or share dimensions across facts. Always reconcile the totals.
Is a star schema always faster?
No. Speed and size depend on your model, the cardinality of its columns, and the queries you run. A star schema is more predictable for correctness and reuse, but you should measure performance on your own data.
Do I need a Date table if I use a flat table?
For reliable time intelligence, yes, a marked Date table related to your date column is the supported approach. Raw date columns on a fact table lack unique, gap-free dates, so test carefully if you skip it. Check the current documentation for how auto date/time behaves in your version.
How do I check my model size and column cardinality?
Use VertiPaq Analyzer through DAX Studio or Tabular Editor to see sizes and cardinality per table and column. You can also run simple DAX queries with DISTINCTCOUNT, as in example 05. Compare the results before and after each change.
Conclusion
The choice between a star schema and a flat table is not about a universal speed winner. It is about grain, correctness, and measurement. Here are the key takeaways:
- Cardinality drives column size, so watch high-cardinality columns in either design.
- Flattening mixes grains, and header-level amounts like Freight overcount when summed on line rows.
- A marked Date table supports time intelligence and role-playing dates.
- Never claim one design is always smaller or faster. Measure with VertiPaq Analyzer, Server Timings, and Performance Analyzer.
- Reconcile totals between designs before you trust either one.
Want more practical Power BI, DAX, and data modeling guides? Visit exceltobi.com for more articles and tutorials.
Related reading: my earlier articles on CALCULATE, calculated tables and columns, and explicit measures.