When should you declare a fact table’s grain?
Declare the business process and state what one fact-table row represents before choosing measures or dimensions. This grain determines which observations belong together.
Study Star Schema and Power BI Data Modeling with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
When should you declare a fact table’s grain?
Declare the business process and state what one fact-table row represents before choosing measures or dimensions. This grain determines which observations belong together.
How does Power BI typically handle order-date and ship-date relationships to one fact table?
In the usual Power BI pattern, only one relationship between a date dimension and a fact table can be active at a time. Use an inactive relationship or separate role-playing date tables when needed.
Which sales measures are usually additive, and which is a rate?
Quantities and sales amounts are usually additive across products, customers, and dates. A rate such as unit price generally should not be summed.
How can you check whether a star schema produces trustworthy results?
Compare small filtered results with a trusted source query or manually checked sample, and validate both detail rows and totals. A plausible grand total can hide grouping or filter-propagation errors.
What belongs in the fact table versus its dimensions?
A fact table holds grain-level events and measures; dimensions hold uniquely keyed entities with descriptive attributes for filtering and grouping.
How can you aggregate unit price meaningfully across sales rows?
When appropriate, calculate a weighted average as total sales divided by total quantity; summing unit prices is usually meaningless.
What does “one row per product line on a posted sales order” imply?
The grain is the precise meaning of one fact-table row. For example, at one row per product line on a posted sales order, an order with three products produces three fact rows.
Why might a warehouse use surrogate keys for dimensions?
Give each dimension row a unique key. Surrogate keys can keep warehouse keys controlled when source identifiers change or dimension history is tracked.
How should a dimension key relate to its matching fact-table key?
Create a one-to-many relationship from the dimension’s unique key to the matching fact-table foreign key. The dimension key is on the “one” side.
What should a test of filter behavior demonstrate?
Test representative business questions, such as sales by product category and year, and verify that dimension filters reach the intended fact rows.
What is the usual filter direction in a star schema, and why avoid bidirectional filtering by default?
Filters normally flow from dimensions to the fact table. Avoid bidirectional filtering by default because it can create ambiguous filter paths.
How should a model handle sales returns?
Define one consistent convention for returns, such as recording them as negative sales or as separate transactions. The appropriate treatment depends on the agreed business convention.
Import files, standardize types, handle errors, and build refreshable transformations.
Combine tables, unpivot data, and validate joins before loading a repeatable report.