Skip to content
All articles
Data Modeling

Data Modeling Best Practices for Analytics Teams

Grain first, keys second, columns last. The dimensional modelling habits that keep warehouses simple for users and fast for engines.

Ajete Isaku 7 min read

Declare the grain before anything else

Every modelling mistake I have had to undo started with an unclear grain. Before choosing a single column, write one sentence that says what a row in the fact table represents — 'one row per order line per day', 'one row per product per store per day'. If the team cannot agree on that sentence, the model is not ready to build.

A declared grain tells you which dimensions are valid, which measures are additive and how to handle late-arriving data. It is also the first thing to check when two reports disagree.

Use surrogate keys and keep dimensions wide

Integer surrogate keys decouple the warehouse from source system keys, make SCD Type 2 history possible and keep fact tables narrow. Dimensions, on the other hand, should be wide and descriptive: users filter and group by attributes, so flatten hierarchies into the dimension instead of forcing extra joins.

  • Add an 'Unknown' member (key -1) to every dimension so facts never fail to load
  • Store both the surrogate key and the business key
  • Use role-playing date dimensions instead of multiple date tables

Model for the semantic layer you will use

Power BI's VertiPaq engine rewards star schemas: one-to-many relationships from dimensions to facts, single-direction filters, and measures defined once in DAX. Snowflaked dimensions usually get flattened again in Power Query anyway — so do it in the warehouse where it can be tested and reused.

  • #Kimball
  • #Star Schema
  • #Power BI