City Builder
Become the Mayor of Datapolis โ design Warehouse star schemas and a Power BI semantic model, one district at a time!
๐ Overview
Welcome, Mayor of Datapolis! Your city is growing fast and the Council needs answers. Build a real Fabric Warehouse and a Power BI semantic model to serve the citizens, district by district.
Each district teaches a core dimensional modeling concept โ surrogate keys, conformed dimensions, semi-additive facts, SCD Type 2 โ and ends with a boss-level galaxy schema uniting all 3 main facts of your city.
๐ Quick Start
# In any Fabric notebook
%pip install -q fabric-arcade
from fabric_arcade import arcade
arcade.install("city-builder", workspace="My Workspace")
# Provisions: Datapolis_LH, Datapolis_DW, Datapolis_EH (KQL),
# CityBuilder_Seed, CityBuilder_Mayor, CityBuilder_Dashboard notebooks.
Then run CityBuilder_Seed once (loads 8 raw datasets into Datapolis_LH),
create an empty Power BI semantic model named Datapolis_Model bound to Datapolis_DW,
open CityBuilder_Mayor, set PLAYER_NAME in Stepย 0, then for each district write the
T-SQL + DAX and run mayor.validate("<district-id>"). Finish with mayor.score()
and mint your signed badge.
๐งฉ How You Play (Real Fabric, Not a Simulation)
City Builder is a learning quest: you model real Fabric Warehouse tables and a Power BI semantic model. Every district follows the same loop:
- ๐ Read the briefing in the
CityBuilder_Mayornotebook (e.g. "Datapolis launched a taxi service โ buildFactTaxiTrip+DimDate,DimDriver,DimZone,DimVehicle"). - ๐ผ Open the empty Warehouse
Datapolis_DWin Fabric and write T-SQL toCREATEthe tables and load them from the raw data inDatapolis_LH. - ๐ Open the Semantic Model
Datapolis_Modelin Fabric, add the required relationships, and author the DAX measures listed in the briefing. - โ๏ธ Back in the notebook, run
mayor.inspect_district("taxi")โ the Mayor validates your schema viaINFORMATION_SCHEMA, runs your DAX measures via the XMLA endpoint, and compares to the expected oracle. Telemetry goes to the Eventhouse. - ๐ The
CityBuilder_Dashboardupdates live with the city map, your Mayor reputation, and the DAX scoreboard.
๐ฆ What Gets Installed in Your Workspace
arcade.install("city-builder") deploys:
- ๐ 1 Lakehouse
Datapolis_LHโ 8 raw datasets (one per district) + 8 expected oracle datasets used for validation. - ๐๏ธ 1 Warehouse
Datapolis_DWโ pre-created empty. You addFact*andDim*tables yourself via T-SQL. - ๐ 1 Semantic Model
Datapolis_Modelโ pre-created empty, bound to the Warehouse. You add relationships and DAX measures in the Fabric UI. - โก 1 Eventhouse
Datapolis_EHwith KQL DatabaseCityDataand tableCityEventsโ Mayor's telemetry for every inspection. - ๐ 3 Notebooks:
CityBuilder_Seedโ generates raw + expected datasets (run once).CityBuilder_Mayorโ district briefings +inspect_district(name)validator.CityBuilder_Dashboardโ live city map + reputation + DAX scoreboard.
๐บ๏ธ The 8 Districts of Datapolis
Each district teaches one star-schema concept. Districts 3, 4 and 5 must be done before the boss.
๐ค What the Mayor (Judge) Checks
- โ Grain โ fact row count matches raw event count
- โ
Keys โ surrogate
INT IDENTITY, no NULL foreign keys - โ Relationships โ many-to-one, single direction (no rogue bidirectional)
- โ Star vs Snowflake โ penalty if you snowflake without reason
- โ
DAX measure values โ executed via XMLA
EVALUATE, compared to oracle - โ Performance โ query time under threshold
๐ Telemetry Events โ Eventhouse
Every Mayor's inspection generates real-time events for analytics:
๐ง Workloads
๐ Mayor Ranks
Each validated district awards reputation; the Mayor's title scales with the cumulative score (max 900).
| Min Reputation | Rank |
|---|---|
| 0 | Suspicious Citizen |
| 100 | ๐ฅ Ward Councilor |
| 250 | ๐ฅ Urban Planning Officer |
| 500 | ๐ฅ Mayor of Datapolis |
| 800 | ๐๏ธ Chief Grid Architect |
| 900 | ๐ Grid Keeper |
๐ What You'll Learn
| Skill | Fabric / Modeling Feature | Level |
|---|---|---|
| Identify facts vs dimensions | Dimensional modeling | โญ |
| Surrogate keys | T-SQL IDENTITY | โญ |
| Conformed dimensions | Star schema basics | โญโญ |
| Semi-additive facts | Snapshot patterns | โญโญ |
| Role-playing dimensions | DAX USERELATIONSHIP | โญโญ |
| Junk + degenerate dims | Kimball patterns | โญโญโญ |
| SCD Type 1 & Type 2 | Slowly Changing Dimensions | โญโญโญ |
| Galaxy schema | Multi-fact conformed modeling | โญโญโญ |
| DAX measures via XMLA | Semantic model authoring | โญโญโญ |
๐ฎ Played it? Tell me!
Tried this game in your Fabric workspace? Share how it went, leave a comment, or report a ๐ bug โ your feedback shapes the next level.
Made with ๐ฎ by the Fabric Community
Not affiliated with Microsoft