Ravindra BagaleCourses & study guides मराठी Track your progress

28. End-to-End Project: Blinkit Quick-Commerce Dashboard

28.4 Step 3 – Build the Data Model

Project data model (star schema) with example — in 30 seconds

What: The project model is a star: one Orders fact table in the middle, with DarkStore, Product, Customer and Date around it.

Why: Every measure in the project depends on these relationships. A wrong direction or a missing date table breaks the cards.

Tiny example: Orders has Store ID, Product ID, Customer ID and Order Date. Each one links to one dimension table.

First look at the data (before → after):

Project data model (star schema) with example: before and after tables, fictional Blinkit Maharashtra data

Same before / after tables as text

Before — Tables after Power Query (no relationships yet)

Table Rows (fictional) Key column
Orders 5,00,000 Order ID
DarkStore 24 Store ID
Product 300 Product ID
Customer 60,000 Customer ID
Date 730 Date

About this data: This table uses columns: Table, Rows (fictional), Key column. This table uses columns: One side, Many side, Cardinality, Direction. Values shown are the lesson examples already on this page (not a new dataset).

Formula / click path

DarkStore[Store ID]     1 → * Orders[Store ID]
Product[Product ID]     1 → * Orders[Product ID]
Customer[Customer ID]   1 → * Orders[Customer ID]
'Date'[Date]            1 → * Orders[Order Date]

After — Relationships to check in Model view

One side Many side Cardinality Direction
DarkStore[Store ID] Orders[Store ID] One to many Single
Product[Product ID] Orders[Product ID] One to many Single
Customer[Customer ID] Orders[Customer ID] One to many Single
'Date'[Date] Orders[Order Date] One to many Single

Do it step by step:

  1. Open Model view.
  2. Drag DarkStore[Store ID] onto Orders[Store ID]. Check: one to many, single direction.
  3. Do the same for Product ID and Customer ID.
  4. Drag Date[Date] onto Orders[Order Date].
  5. Select the Date table. Click Table tools › Mark as date table and pick the Date column.
  6. Hide the key columns on the Orders side, so users pick fields from the dimension tables.

What appears on screen after these steps — sample layout, fictional data

What you should see on screen after the steps (sample layout — fictional data, not a Microsoft screenshot).

Checkpoint C

Manage relationships: Orders many-to-one to each dimension. Mark Date as date table. Hide foreign keys on the fact if you teach star schema hygiene.

  1. Create the Date table with DAX (Module 11) covering the years in the data, with Year, Quarter, Month Number, Month Name, Year Month, Fiscal Year, Day Name, Is Weekend, and the Festival / Is Festival Day columns from a small Festivals table.
  2. Mark as date table; sort Month Name by Month Number; turn off Auto date/time.
  3. Create relationships (Model view), all one-to-many and single direction:
    • Product[Product ID] 1:* Orders[Product ID]
    • Customer[Customer ID] 1:* Orders[Customer ID]
    • DarkStore[Store ID] 1:* Orders[Store ID]
    • DeliveryPartner[Delivery Partner ID] 1:* Orders[Delivery Partner ID]
    • Date[Date] 1:* Orders[Order Date] (active)
    • Date[Date] 1:* Orders[Delivered Date] (inactive)
  4. Hide all key columns in Orders.
  5. Create hierarchies: Date (Year › Quarter › Month Name › Date), Product (Category › Sub Category › Product Name), Location (State › City › Area › Store Name). Set data categories for City, State and Country.
  6. Create a _Measures table with display folders Sales, Orders, Delivery, Customers, Time, Platform, UI.

Model tayar jhala? Shabbas! Aata measures lihuya.

Ravindra Bagale's Tip

Friends, many students forget to mark the Date table or leave Auto date/time on, and time intelligence later gives strange results. Build the star schema, mark the Date table, set single-direction relationships and hide the keys before you write any measure. This matters for both exams and interviews.

Ravi Sir's Cards for this lesson

मराठी cards