Calc Groups Cathedral
Replace 12 redundant time-intelligence measures with one elegant Calculation Group on a real Direct Lake semantic model. Earn the rank of Cathedral Builder.
๐ Overview
You are the Chief Architect of the Vertipaq Cathedral. Twelve KPI pillars need to live on a real
Direct Lake semantic model: Current, LastYear, YoY, YoY%, YTD,
MTD, QTD, Rolling12, BestMonth, %OfYear,
AvgDailySales, DistinctCustomers.
The apprentice's way: 12 measures, each one re-typing the same SUM(Sales[Amount]).
The architect's way: 1 base measure + 1 Calculation Group with 11 items
(DistinctCustomers stays standalone โ it changes the aggregation, not the time context).
Every submission is graded for correctness on 3 contexts and rewarded with an elegance score
that penalizes long DAX, redundant CALCULATE, and unnecessary FILTER / SUMX.
๐ Quick Start
# In any Fabric notebook
%pip install -q fabric-arcade
from fabric_arcade import arcade
arcade.install("calc-groups-cathedral", workspace="My Workspace")
# Provisions: Cathedral_LH (Lakehouse), Cathedral_EH (Eventhouse + CathedralEvents table),
# 01_Setup, 02_Quest, 03_Check, 04_Dashboard notebooks.
Then in the new workspace: open 01_Setup and run it once
(synthetic data โ Lakehouse โ Direct Lake Cathedral_Model with the seed measure).
Open 02_Quest, build your pillars on Cathedral_Model, then run 03_Check to submit.
Track progress in 04_Dashboard.
๐งฉ How You Play
- ๐
01_Setupgenerates 3 years of synthetic Sales/Date/Customer/Budget and buildsCathedral_Modelwith the seed measure[Sales Amount Seed] = SUM(Sales[Amount]). - ๐
02_Questshows the 12 pillar specs and the Final Challenge brief. - โ๏ธ Open
Cathedral_Modelin the Fabric web UI (or use sempy-labs from any notebook) and author measuresM_01_CurrentโฆM_12_DistinctCustomers. - ๐๏ธ Build the calculation group
'Time Intelligence'[Calc]with 11 items wrappingSELECTEDMEASURE(). - โ๏ธ Run
03_Checkโ it evaluates each pillar via DAX on 3 contexts, scores elegance, assigns rank, and shipsPillarPassed/PillarFailed/RankPromotedevents to KQL. - ๐
04_Dashboardrenders a live Plotly view of your run: state, timeline, measures vs calc group, session recap.
๐ฆ What Gets Installed
- ๐ Lakehouse
Cathedral_LHโ populated at runtime with Sales / Date / Customer / Budget Delta tables (3 years). - โก Eventhouse
Cathedral_EH+ tableCathedralEvents(15 columns, PascalCase, 90d retention). - ๐ 4 Notebooks:
01_Setup,02_Quest,03_Check,04_Dashboard.
The semantic model Cathedral_Model is built at runtime by 01_Setup (via sempy-labs / TOM), so it does not appear in the install plan โ but it is created in the same workspace as part of the first run.
๐ The 12 Pillars
SUMSAMEPERIODLASTYEARDIVIDE(YoY, LY)DATESYTDDATESMTDDATESQTDDATESINPERIOD -12 monthsMAXX over monthsALL ratioAVERAGEX over datesDISTINCTCOUNT โ different aggregation, stays outside the calc group๐๏ธ The Final Challenge โ One Calc Group, 11 Items
Collapse pillars 1 through 11 into a single Calculation Group:
// table 'Time Intelligence', column [Calc], 11 calc items
// Each item wraps SELECTEDMEASURE() โ applies to any base measure
Current = SELECTEDMEASURE()
LastYear = CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Date'[Date]))
YoY = SELECTEDMEASURE() - CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Date'[Date]))
YoYPct = DIVIDE(/* YoY */, /* LY */)
YTD = CALCULATE(SELECTEDMEASURE(), DATESYTD('Date'[Date]))
MTD = CALCULATE(SELECTEDMEASURE(), DATESMTD('Date'[Date]))
QTD = CALCULATE(SELECTEDMEASURE(), DATESQTD('Date'[Date]))
Rolling12 = CALCULATE(SELECTEDMEASURE(), DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -12, MONTH))
BestMonth = MAXX(VALUES('Date'[MonthNum]), SELECTEDMEASURE())
PctOfYear = DIVIDE(SELECTEDMEASURE(), CALCULATE(SELECTEDMEASURE(), ALL('Date'[MonthNum], 'Date'[Quarter])))
AvgDaily = AVERAGEX(VALUES('Date'[Date]), SELECTEDMEASURE())
Why 11, not 12? DistinctCustomers swaps the aggregation entirely (DISTINCTCOUNT vs SUM) โ it isn't a time-context shift, so it belongs outside the group.
โ๏ธ Scoring & Ranks
elegance = max(0, 100
โ max(0, len(dax) โ 60) * 0.4
โ max(0, count(CALCULATE) โ 1) * 8
โ count(FILTER) * 6
โ count(SUMX) * 4)
score = 50 + elegance * 0.5 # only if all 3 contexts pass
| Min Score | Rank |
|---|---|
| 0 | Stonemason |
| 300 | Apprentice |
| 700 | Journeyman |
| 1100 | Architect |
| 1500 | Master Architect |
| 1800 | ๐ Cathedral Builder |
๐ Telemetry โ CathedralEvents
๐ง Workloads
๐ What You'll Learn
| Skill | Power BI Feature | Level |
|---|---|---|
| Calculation Groups | TMDL calculationGroup + SELECTEDMEASURE() | โญโญโญ |
| Calc items vs measures | TOM modeling | โญโญ |
| Time Intelligence | DATESYTD, SAMEPERIODLASTYEARโฆ | โญโญ |
| Programmatic modeling | sempy-labs TOM | โญโญโญ |
| Direct Lake semantic models | Lakehouse-backed Tabular | โญโญโญ |
| Real-time telemetry | Eventhouse streaming ingest | โญโญ |
| Model minimalism | Maintainable PBI design | โญโญโญ |
๐ฎ 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