@luquimbo/bi-superpowers 3.1.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/.claude-plugin/marketplace.json +5 -3
  2. package/.claude-plugin/plugin.json +28 -2
  3. package/.claude-plugin/skill-manifest.json +22 -6
  4. package/.plugin/plugin.json +1 -1
  5. package/AGENTS.md +52 -36
  6. package/CHANGELOG.md +295 -0
  7. package/README.md +75 -26
  8. package/bin/build-plugin.js +17 -10
  9. package/bin/cli.js +278 -322
  10. package/bin/commands/build-desktop.js +35 -16
  11. package/bin/commands/diff.js +31 -13
  12. package/bin/commands/install.js +93 -72
  13. package/bin/commands/lint.js +40 -26
  14. package/bin/commands/mcp-setup.js +3 -10
  15. package/bin/commands/update-check.js +389 -0
  16. package/bin/lib/agents.js +19 -0
  17. package/bin/lib/generators/claude-plugin.js +144 -6
  18. package/bin/lib/generators/shared.js +29 -33
  19. package/bin/lib/mcp-config.js +191 -16
  20. package/bin/lib/skills.js +115 -27
  21. package/bin/postinstall.js +4 -2
  22. package/bin/utils/mcp-detect.js +2 -2
  23. package/commands/bi-start.md +218 -0
  24. package/commands/pbi-connect.md +43 -65
  25. package/commands/project-kickoff.md +393 -673
  26. package/commands/report-design.md +403 -0
  27. package/desktop-extension/manifest.json +5 -12
  28. package/desktop-extension/server.js +34 -25
  29. package/package.json +6 -10
  30. package/skills/bi-start/SKILL.md +220 -0
  31. package/skills/bi-start/scripts/update-check.js +389 -0
  32. package/skills/pbi-connect/SKILL.md +45 -67
  33. package/skills/pbi-connect/scripts/update-check.js +389 -0
  34. package/skills/project-kickoff/SKILL.md +395 -675
  35. package/skills/project-kickoff/scripts/update-check.js +389 -0
  36. package/skills/report-design/SKILL.md +405 -0
  37. package/skills/report-design/references/cli-commands.md +184 -0
  38. package/skills/report-design/references/cli-setup.md +101 -0
  39. package/skills/report-design/references/close-write-open-pattern.md +80 -0
  40. package/skills/report-design/references/layouts/finance.md +65 -0
  41. package/skills/report-design/references/layouts/generic.md +46 -0
  42. package/skills/report-design/references/layouts/hr.md +48 -0
  43. package/skills/report-design/references/layouts/marketing.md +45 -0
  44. package/skills/report-design/references/layouts/operations.md +44 -0
  45. package/skills/report-design/references/layouts/sales.md +50 -0
  46. package/skills/report-design/references/native-visuals.md +341 -0
  47. package/skills/report-design/references/pbi-desktop-installation.md +87 -0
  48. package/skills/report-design/references/pbir-preview-activation.md +40 -0
  49. package/skills/report-design/references/slicer.md +89 -0
  50. package/skills/report-design/references/textbox.md +101 -0
  51. package/skills/report-design/references/themes/BISuperpowers.json +915 -0
  52. package/skills/report-design/references/troubleshooting.md +135 -0
  53. package/skills/report-design/references/visual-types.md +78 -0
  54. package/skills/report-design/scripts/apply-theme.js +243 -0
  55. package/skills/report-design/scripts/create-visual.js +878 -0
  56. package/skills/report-design/scripts/ensure-pbi-cli.sh +41 -0
  57. package/skills/report-design/scripts/update-check.js +389 -0
  58. package/skills/report-design/scripts/validate-pbir.js +322 -0
  59. package/src/content/base.md +12 -68
  60. package/src/content/mcp-requirements.json +0 -25
  61. package/src/content/routing.md +19 -74
  62. package/src/content/skills/bi-start.md +191 -0
  63. package/src/content/skills/pbi-connect.md +22 -65
  64. package/src/content/skills/project-kickoff.md +372 -673
  65. package/src/content/skills/report-design/SKILL.md +376 -0
  66. package/src/content/skills/report-design/references/cli-commands.md +184 -0
  67. package/src/content/skills/report-design/references/cli-setup.md +101 -0
  68. package/src/content/skills/report-design/references/close-write-open-pattern.md +80 -0
  69. package/src/content/skills/report-design/references/layouts/finance.md +65 -0
  70. package/src/content/skills/report-design/references/layouts/generic.md +46 -0
  71. package/src/content/skills/report-design/references/layouts/hr.md +48 -0
  72. package/src/content/skills/report-design/references/layouts/marketing.md +45 -0
  73. package/src/content/skills/report-design/references/layouts/operations.md +44 -0
  74. package/src/content/skills/report-design/references/layouts/sales.md +50 -0
  75. package/src/content/skills/report-design/references/native-visuals.md +341 -0
  76. package/src/content/skills/report-design/references/pbi-desktop-installation.md +87 -0
  77. package/src/content/skills/report-design/references/pbir-preview-activation.md +40 -0
  78. package/src/content/skills/report-design/references/slicer.md +89 -0
  79. package/src/content/skills/report-design/references/textbox.md +101 -0
  80. package/src/content/skills/report-design/references/themes/BISuperpowers.json +915 -0
  81. package/src/content/skills/report-design/references/troubleshooting.md +135 -0
  82. package/src/content/skills/report-design/references/visual-types.md +78 -0
  83. package/src/content/skills/report-design/scripts/apply-theme.js +243 -0
  84. package/src/content/skills/report-design/scripts/create-visual.js +878 -0
  85. package/src/content/skills/report-design/scripts/ensure-pbi-cli.sh +41 -0
  86. package/src/content/skills/report-design/scripts/validate-pbir.js +322 -0
  87. package/bin/commands/add.js +0 -533
  88. package/bin/commands/add.test.js +0 -77
  89. package/bin/commands/changelog.js +0 -443
  90. package/bin/commands/install.test.js +0 -289
  91. package/bin/commands/lint.test.js +0 -103
  92. package/bin/commands/pull.js +0 -287
  93. package/bin/commands/pull.test.js +0 -36
  94. package/bin/commands/push.js +0 -231
  95. package/bin/commands/push.test.js +0 -14
  96. package/bin/commands/search.js +0 -344
  97. package/bin/commands/search.test.js +0 -115
  98. package/bin/commands/setup.js +0 -545
  99. package/bin/commands/setup.test.js +0 -46
  100. package/bin/commands/sync-profile.js +0 -405
  101. package/bin/commands/sync-profile.test.js +0 -14
  102. package/bin/commands/sync-source.js +0 -418
  103. package/bin/commands/sync-source.test.js +0 -14
  104. package/bin/lib/generators/claude-plugin.test.js +0 -111
  105. package/bin/lib/mcp-config.test.js +0 -310
  106. package/bin/lib/microsoft-mcp.test.js +0 -115
  107. package/bin/utils/errors.js +0 -159
  108. package/bin/utils/git.js +0 -298
  109. package/bin/utils/logger.js +0 -142
  110. package/bin/utils/mcp-detect.test.js +0 -81
  111. package/bin/utils/pbix.js +0 -305
  112. package/bin/utils/pbix.test.js +0 -37
  113. package/bin/utils/profiles.js +0 -312
  114. package/bin/utils/projects.js +0 -169
  115. package/bin/utils/readline.js +0 -206
  116. package/bin/utils/readline.test.js +0 -47
  117. package/bin/utils/tui.test.js +0 -127
  118. package/docs/openrouter-free-models.md +0 -92
  119. package/library/examples/README.md +0 -151
  120. package/library/examples/finance-reporting/README.md +0 -351
  121. package/library/examples/finance-reporting/data-model.md +0 -267
  122. package/library/examples/finance-reporting/measures.dax +0 -557
  123. package/library/examples/hr-analytics/README.md +0 -371
  124. package/library/examples/hr-analytics/data-model.md +0 -315
  125. package/library/examples/hr-analytics/measures.dax +0 -460
  126. package/library/examples/marketing-analytics/README.md +0 -37
  127. package/library/examples/marketing-analytics/data-model.md +0 -62
  128. package/library/examples/marketing-analytics/measures.dax +0 -110
  129. package/library/examples/retail-analytics/README.md +0 -439
  130. package/library/examples/retail-analytics/data-model.md +0 -288
  131. package/library/examples/retail-analytics/measures.dax +0 -481
  132. package/library/examples/supply-chain/README.md +0 -37
  133. package/library/examples/supply-chain/data-model.md +0 -69
  134. package/library/examples/supply-chain/measures.dax +0 -77
  135. package/library/examples/udf-library/README.md +0 -228
  136. package/library/examples/udf-library/functions.dax +0 -571
  137. package/library/snippets/dax/README.md +0 -292
  138. package/library/snippets/dax/business-domains.md +0 -576
  139. package/library/snippets/dax/calculate-patterns.md +0 -276
  140. package/library/snippets/dax/calculation-groups.md +0 -489
  141. package/library/snippets/dax/error-handling.md +0 -495
  142. package/library/snippets/dax/iterators-and-aggregations.md +0 -474
  143. package/library/snippets/dax/kpis-and-metrics.md +0 -293
  144. package/library/snippets/dax/rankings-and-topn.md +0 -235
  145. package/library/snippets/dax/security-patterns.md +0 -413
  146. package/library/snippets/dax/text-and-formatting.md +0 -316
  147. package/library/snippets/dax/time-intelligence.md +0 -196
  148. package/library/snippets/dax/user-defined-functions.md +0 -477
  149. package/library/snippets/dax/virtual-tables.md +0 -546
  150. package/library/snippets/excel-formulas/README.md +0 -84
  151. package/library/snippets/excel-formulas/aggregations.md +0 -330
  152. package/library/snippets/excel-formulas/dates-and-times.md +0 -361
  153. package/library/snippets/excel-formulas/dynamic-arrays.md +0 -314
  154. package/library/snippets/excel-formulas/lookups.md +0 -169
  155. package/library/snippets/excel-formulas/text-functions.md +0 -363
  156. package/library/snippets/governance/naming-conventions.md +0 -97
  157. package/library/snippets/governance/review-checklists.md +0 -107
  158. package/library/snippets/power-query/README.md +0 -389
  159. package/library/snippets/power-query/api-integration.md +0 -707
  160. package/library/snippets/power-query/connections.md +0 -434
  161. package/library/snippets/power-query/data-cleaning.md +0 -298
  162. package/library/snippets/power-query/error-handling.md +0 -526
  163. package/library/snippets/power-query/parameters.md +0 -350
  164. package/library/snippets/power-query/performance.md +0 -506
  165. package/library/snippets/power-query/transformations.md +0 -330
  166. package/library/snippets/report-design/accessibility.md +0 -78
  167. package/library/snippets/report-design/chart-selection.md +0 -54
  168. package/library/snippets/report-design/layout-patterns.md +0 -87
  169. package/library/templates/data-models/README.md +0 -93
  170. package/library/templates/data-models/finance-model.md +0 -627
  171. package/library/templates/data-models/retail-star-schema.md +0 -473
  172. package/library/templates/excel/README.md +0 -83
  173. package/library/templates/excel/budget-tracker.md +0 -432
  174. package/library/templates/excel/data-entry-form.md +0 -533
  175. package/library/templates/power-bi/README.md +0 -72
  176. package/library/templates/power-bi/finance-report.md +0 -449
  177. package/library/templates/power-bi/kpi-scorecard.md +0 -461
  178. package/library/templates/power-bi/sales-dashboard.md +0 -281
  179. package/library/themes/excel/README.md +0 -436
  180. package/library/themes/power-bi/README.md +0 -271
  181. package/library/themes/power-bi/accessible.json +0 -307
  182. package/library/themes/power-bi/bi-superpowers-default.json +0 -858
  183. package/library/themes/power-bi/corporate-blue.json +0 -291
  184. package/library/themes/power-bi/dark-mode.json +0 -291
  185. package/library/themes/power-bi/minimal.json +0 -292
  186. package/library/themes/power-bi/print-friendly.json +0 -309
@@ -1,151 +0,0 @@
1
- # Examples
2
-
3
- Complete, end-to-end examples demonstrating BI Agent Superpowers patterns in real-world scenarios.
4
-
5
- ---
6
-
7
- ## Available Examples
8
-
9
- | Example | Description | Components |
10
- |---------|-------------|------------|
11
- | [retail-analytics](./retail-analytics/) | Complete retail sales analytics solution | Star schema, 50+ DAX measures, data model |
12
- | [finance-reporting](./finance-reporting/) | P&L, Balance Sheet, variance analysis | Multi-statement model, 60+ financial measures |
13
- | [hr-analytics](./hr-analytics/) | Headcount, turnover, diversity metrics | Employee snapshots, 40+ HR measures |
14
- | [udf-library](./udf-library/) | DAX User Defined Functions library | 50+ reusable UDFs, typed parameters |
15
-
16
- ---
17
-
18
- ## Learning Path (Recommended Order)
19
-
20
- New to Power BI? Follow this progression to build your skills:
21
-
22
- ### Level 1: Foundations
23
- 1. **[retail-analytics](./retail-analytics/)** - Start here!
24
- - Learn star schema basics (facts + dimensions)
25
- - Understand fundamental DAX patterns (SUM, CALCULATE, time intelligence)
26
- - Build your first KPI dashboard
27
-
28
- ### Level 2: Intermediate
29
- 2. **[hr-analytics](./hr-analytics/)** - Expand your skills
30
- - Work with snapshot data (point-in-time analysis)
31
- - Learn turnover and retention calculations
32
- - Understand Row-Level Security (RLS) basics
33
-
34
- ### Level 3: Advanced
35
- 3. **[finance-reporting](./finance-reporting/)** - Master complex scenarios
36
- - Handle multi-statement financial models
37
- - Work with hierarchical account structures
38
- - Build variance analysis (Actual vs Budget)
39
-
40
- ### Level 4: Expert
41
- 4. **[udf-library](./udf-library/)** - Cutting-edge DAX
42
- - Create reusable User Defined Functions (preview feature)
43
- - Build a personal library of typed functions
44
- - Master advanced DAX patterns
45
-
46
- ---
47
-
48
- ## What Each Example Includes
49
-
50
- ### Documentation
51
- - **README.md** - Overview, business requirements, implementation guide
52
- - **data-model.md** - Complete table definitions, relationships, sample data
53
-
54
- ### Code
55
- - **measures.dax** - Complete DAX measure library, organized by category
56
-
57
- ### Styling
58
- - Use themes from `library/themes/power-bi/` for consistent formatting
59
-
60
- ---
61
-
62
- ## Using Examples
63
-
64
- ### 1. Understand the Scenario
65
-
66
- Read the README.md to understand:
67
- - Business requirements and stakeholders
68
- - Key questions the solution answers
69
- - Recommended visualizations
70
-
71
- ### 2. Adapt the Data Model
72
-
73
- Use data-model.md as a template:
74
- - Match columns to your source data
75
- - Adjust data types as needed
76
- - Add/remove columns for your scenario
77
-
78
- ### 3. Copy Relevant Measures
79
-
80
- From measures.dax:
81
- - Start with base measures (Revenue, Cost, Profit)
82
- - Add time intelligence as needed
83
- - Customize rankings and percentages
84
-
85
- ### 4. Apply a Theme
86
-
87
- 1. Choose a theme from `library/themes/power-bi/`
88
- 2. View > Themes > Browse for themes
89
- 3. Select the JSON file
90
-
91
- ---
92
-
93
- ## Example Structure
94
-
95
- ```
96
- library/examples/
97
- ├── README.md # This file
98
-
99
- ├── retail-analytics/ # Retail sales analytics
100
- │ ├── README.md # Overview and guide
101
- │ ├── data-model.md # Table definitions
102
- │ └── measures.dax # 50+ DAX measures
103
-
104
- ├── finance-reporting/ # Financial statements
105
- │ ├── README.md # P&L, Balance Sheet guide
106
- │ ├── data-model.md # Account structure, scenarios
107
- │ └── measures.dax # 60+ financial measures
108
-
109
- ├── hr-analytics/ # HR workforce analytics
110
- │ ├── README.md # Headcount, turnover guide
111
- │ ├── data-model.md # Employee snapshot model
112
- │ └── measures.dax # 40+ HR measures
113
-
114
- └── udf-library/ # DAX User Defined Functions
115
- ├── README.md # UDF usage guide and catalog
116
- └── functions.dax # 50+ reusable typed functions
117
- ```
118
-
119
- ---
120
-
121
- ## Upcoming Examples
122
-
123
- - **marketing-dashboard** - Campaign performance, funnel analysis
124
- - **supply-chain** - Inventory, fulfillment, vendor performance
125
- - **project-management** - Resource allocation, timeline tracking
126
-
127
- ---
128
-
129
- ## Contributing Examples
130
-
131
- Want to add an example? Include:
132
-
133
- 1. **README.md** with:
134
- - Business scenario description
135
- - Stakeholder requirements
136
- - Data model diagram
137
- - Visualization recommendations
138
- - Implementation checklist
139
-
140
- 2. **data-model.md** with:
141
- - All table definitions
142
- - Column specifications
143
- - Relationship diagram
144
- - Sample data
145
-
146
- 3. **measures.dax** with:
147
- - Organized by category
148
- - Comments explaining each measure
149
- - Naming conventions followed
150
-
151
- See [CONTRIBUTING.md](../../CONTRIBUTING.md) for submission guidelines.
@@ -1,351 +0,0 @@
1
- # Finance Reporting - Complete Example
2
-
3
- A comprehensive financial reporting solution for P&L, Balance Sheet, and Cash Flow analysis.
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- This example demonstrates building a complete financial reporting solution using:
10
-
11
- - **Multi-statement data model** supporting P&L, Balance Sheet, and Cash Flow
12
- - **DAX measures** for period comparisons, variances, and financial ratios
13
- - **Budget vs Actual** analysis with variance explanations
14
- - **Rolling forecasts** and trend analysis
15
-
16
- ---
17
-
18
- ## Business Requirements
19
-
20
- ### Stakeholders
21
- - CFO: Executive financial overview
22
- - Controllers: Detailed variance analysis
23
- - FP&A Team: Budget tracking and forecasting
24
- - Business Unit Leaders: Departmental P&L
25
-
26
- ### Key Questions
27
- 1. How are we performing vs. budget and prior year?
28
- 2. What's driving variance from plan?
29
- 3. What are our key financial ratios and trends?
30
- 4. How does each department/cost center perform?
31
- 5. What's the cash position and forecast?
32
-
33
- ---
34
-
35
- ## Data Model
36
-
37
- ### Star Schema Design
38
-
39
- ```
40
- ┌─────────────────┐
41
- │ DimDate │
42
- │─────────────────│
43
- │ DateKey (PK) │
44
- │ Date │
45
- │ FiscalYear │
46
- │ FiscalPeriod │
47
- │ FiscalQuarter │
48
- │ IsCurrentPeriod │
49
- └────────┬────────┘
50
-
51
- ┌─────────────────┐ │ ┌─────────────────┐
52
- │ DimAccount │ │ │ DimCostCenter │
53
- │─────────────────│ │ │─────────────────│
54
- │ AccountKey (PK) │ │ │ CostCenterKey │
55
- │ AccountCode │ │ │ CostCenterCode │
56
- │ AccountName │ │ │ CostCenterName │
57
- │ AccountType │ │ │ Department │
58
- │ AccountGroup │ │ │ Division │
59
- │ FinancialStmt │ │ │ Manager │
60
- │ NaturalSign │ │ └────────┬────────┘
61
- │ SortOrder │ │ │
62
- └────────┬────────┘ │ │
63
- │ ┌─────────────┴───────────────┐ │
64
- │ │ FactFinancials │ │
65
- │ │─────────────────────────────│ │
66
- └────>│ FinancialKey (PK) │<──┘
67
- │ DateKey (FK) │
68
- │ AccountKey (FK) │
69
- │ CostCenterKey (FK) │
70
- │ ScenarioKey (FK) │
71
- │ Amount │
72
- └─────────────┬───────────────┘
73
-
74
- ┌────────┴────────┐
75
- │ DimScenario │
76
- │─────────────────│
77
- │ ScenarioKey (PK)│
78
- │ ScenarioName │
79
- │ ScenarioType │
80
- │ IsActual │
81
- └─────────────────┘
82
- ```
83
-
84
- ### Account Types
85
-
86
- | AccountType | FinancialStatement | NaturalSign | Examples |
87
- |-------------|-------------------|-------------|----------|
88
- | Revenue | Income Statement | Credit (+) | Sales, Service Revenue |
89
- | COGS | Income Statement | Debit (-) | Cost of Goods Sold |
90
- | OpEx | Income Statement | Debit (-) | Salaries, Rent, Marketing |
91
- | OtherIncome | Income Statement | Credit (+) | Interest Income |
92
- | OtherExpense | Income Statement | Debit (-) | Interest Expense |
93
- | Tax | Income Statement | Debit (-) | Income Tax |
94
- | Asset | Balance Sheet | Debit (+) | Cash, AR, Inventory |
95
- | Liability | Balance Sheet | Credit (-) | AP, Debt |
96
- | Equity | Balance Sheet | Credit (-) | Retained Earnings |
97
-
98
- ### Scenarios
99
-
100
- | ScenarioName | ScenarioType | IsActual | Purpose |
101
- |--------------|--------------|----------|---------|
102
- | Actual | Actual | TRUE | Recorded transactions |
103
- | Budget | Budget | FALSE | Annual plan |
104
- | Forecast | Forecast | FALSE | Rolling forecast |
105
- | Prior Year | Actual | TRUE | Comparison baseline |
106
-
107
- ---
108
-
109
- ## Key Measures
110
-
111
- ### Base Measures
112
-
113
- ```dax
114
- // Actuals only
115
- Actual Amount =
116
- CALCULATE(
117
- SUM(FactFinancials[Amount]),
118
- DimScenario[IsActual] = TRUE()
119
- )
120
-
121
- // Budget only
122
- Budget Amount =
123
- CALCULATE(
124
- SUM(FactFinancials[Amount]),
125
- DimScenario[ScenarioName] = "Budget"
126
- )
127
-
128
- // Forecast only
129
- Forecast Amount =
130
- CALCULATE(
131
- SUM(FactFinancials[Amount]),
132
- DimScenario[ScenarioName] = "Forecast"
133
- )
134
- ```
135
-
136
- ### Income Statement Measures
137
-
138
- ```dax
139
- // Revenue (positive = good)
140
- Revenue =
141
- CALCULATE(
142
- [Actual Amount],
143
- DimAccount[AccountType] = "Revenue"
144
- )
145
-
146
- // Gross Profit
147
- Gross Profit =
148
- [Revenue] + CALCULATE([Actual Amount], DimAccount[AccountType] = "COGS")
149
-
150
- // Gross Margin %
151
- Gross Margin % =
152
- DIVIDE([Gross Profit], [Revenue])
153
-
154
- // Operating Expenses
155
- OpEx =
156
- CALCULATE(
157
- [Actual Amount],
158
- DimAccount[AccountType] = "OpEx"
159
- )
160
-
161
- // EBITDA
162
- EBITDA =
163
- [Gross Profit] + [OpEx]
164
-
165
- // Net Income
166
- Net Income =
167
- CALCULATE(
168
- [Actual Amount],
169
- DimAccount[FinancialStmt] = "Income Statement"
170
- )
171
- ```
172
-
173
- ### Variance Analysis
174
-
175
- ```dax
176
- // Budget Variance (Actual - Budget)
177
- Budget Variance =
178
- [Actual Amount] - [Budget Amount]
179
-
180
- // Budget Variance %
181
- Budget Variance % =
182
- DIVIDE([Budget Variance], ABS([Budget Amount]))
183
-
184
- // Favorable/Unfavorable indicator
185
- Variance Status =
186
- VAR _Variance = [Budget Variance]
187
- VAR _AccountType = SELECTEDVALUE(DimAccount[AccountType])
188
- VAR _IsExpense = _AccountType IN {"COGS", "OpEx", "OtherExpense", "Tax"}
189
- RETURN
190
- SWITCH(
191
- TRUE(),
192
- ISBLANK(_Variance), BLANK(),
193
- _IsExpense && _Variance < 0, "Favorable",
194
- _IsExpense && _Variance > 0, "Unfavorable",
195
- NOT _IsExpense && _Variance > 0, "Favorable",
196
- "Unfavorable"
197
- )
198
- ```
199
-
200
- ### YTD and Period Comparisons
201
-
202
- ```dax
203
- // Year-to-Date Actual
204
- Actual YTD =
205
- TOTALYTD([Actual Amount], DimDate[Date])
206
-
207
- // Prior Year Same Period
208
- Actual PY =
209
- CALCULATE(
210
- [Actual Amount],
211
- SAMEPERIODLASTYEAR(DimDate[Date])
212
- )
213
-
214
- // Prior Year YTD
215
- Actual YTD PY =
216
- CALCULATE(
217
- [Actual YTD],
218
- SAMEPERIODLASTYEAR(DimDate[Date])
219
- )
220
-
221
- // YoY Growth %
222
- YoY Growth % =
223
- DIVIDE([Actual Amount] - [Actual PY], ABS([Actual PY]))
224
- ```
225
-
226
- See [measures.dax](./measures.dax) for the complete measure library (50+ measures).
227
-
228
- ---
229
-
230
- ## Report Pages
231
-
232
- ### 1. Executive Summary
233
-
234
- | Visual | Content |
235
- |--------|---------|
236
- | KPI Cards | Revenue, Net Income, EBITDA with YoY % |
237
- | Waterfall | Revenue to Net Income bridge |
238
- | Line Chart | Monthly trend vs Prior Year |
239
- | Table | Key metrics by Quarter |
240
-
241
- ### 2. P&L Statement
242
-
243
- | Visual | Content |
244
- |--------|---------|
245
- | Matrix | Full P&L with hierarchy (Account Group > Account) |
246
- | Columns | Actual, Budget, Variance, Variance %, PY |
247
- | Conditional | Red/Green variance highlighting |
248
- | Drill-through | To account detail page |
249
-
250
- ### 3. Variance Analysis
251
-
252
- | Visual | Content |
253
- |--------|---------|
254
- | Decomposition Tree | Variance drivers by dimension |
255
- | Scatter Plot | Budget vs Actual by Cost Center |
256
- | Table | Top 10 variances with explanations |
257
- | Bar Chart | Variance by Department |
258
-
259
- ### 4. Balance Sheet
260
-
261
- | Visual | Content |
262
- |--------|---------|
263
- | Matrix | Assets, Liabilities, Equity structure |
264
- | KPI Cards | Current Ratio, Quick Ratio, Debt/Equity |
265
- | Waterfall | Change in Cash position |
266
-
267
- ### 5. Cash Flow
268
-
269
- | Visual | Content |
270
- |--------|---------|
271
- | Waterfall | Operating, Investing, Financing flows |
272
- | Line Chart | Cash balance trend |
273
- | Table | Cash sources and uses |
274
-
275
- ---
276
-
277
- ## Financial Ratios
278
-
279
- ```dax
280
- // Profitability
281
- Gross Margin % = DIVIDE([Gross Profit], [Revenue])
282
- Operating Margin % = DIVIDE([EBITDA], [Revenue])
283
- Net Margin % = DIVIDE([Net Income], [Revenue])
284
- ROE = DIVIDE([Net Income TTM], [Total Equity])
285
- ROA = DIVIDE([Net Income TTM], [Total Assets])
286
-
287
- // Liquidity
288
- Current Ratio = DIVIDE([Current Assets], [Current Liabilities])
289
- Quick Ratio = DIVIDE([Current Assets] - [Inventory], [Current Liabilities])
290
- Cash Ratio = DIVIDE([Cash], [Current Liabilities])
291
-
292
- // Leverage
293
- Debt to Equity = DIVIDE([Total Debt], [Total Equity])
294
- Debt to Assets = DIVIDE([Total Debt], [Total Assets])
295
- Interest Coverage = DIVIDE([EBITDA], [Interest Expense])
296
-
297
- // Efficiency
298
- Days Sales Outstanding = DIVIDE([Accounts Receivable], [Revenue]) * 365
299
- Days Payable Outstanding = DIVIDE([Accounts Payable], [COGS]) * 365
300
- Inventory Turnover = DIVIDE([COGS], [Average Inventory])
301
- ```
302
-
303
- ---
304
-
305
- ## Implementation Checklist
306
-
307
- ### Data Model
308
- - [ ] Create DimDate with fiscal calendar attributes
309
- - [ ] Create DimAccount with proper hierarchy and signs
310
- - [ ] Create DimCostCenter with department/division structure
311
- - [ ] Create DimScenario for Actual/Budget/Forecast
312
- - [ ] Load FactFinancials with all scenario data
313
- - [ ] Set up relationships
314
- - [ ] Mark DimDate as Date Table
315
-
316
- ### Measures
317
- - [ ] Create base measures (Actual, Budget, Forecast)
318
- - [ ] Create P&L subtotals (Revenue, Gross Profit, EBITDA, Net Income)
319
- - [ ] Create variance measures with favorable/unfavorable logic
320
- - [ ] Create time intelligence (YTD, PY, YoY)
321
- - [ ] Create financial ratios
322
- - [ ] Organize in display folders
323
-
324
- ### Reports
325
- - [ ] Executive Summary page
326
- - [ ] P&L Statement with drill-through
327
- - [ ] Variance Analysis with decomposition
328
- - [ ] Balance Sheet snapshot
329
- - [ ] Cash Flow statement
330
- - [ ] Apply theme and formatting
331
-
332
- ---
333
-
334
- ## Files in This Example
335
-
336
- | File | Description |
337
- |------|-------------|
338
- | [README.md](./README.md) | This overview |
339
- | [data-model.md](./data-model.md) | Complete table definitions |
340
- | [measures.dax](./measures.dax) | 50+ DAX measures |
341
-
342
- ---
343
-
344
- ## Tips for Financial Reporting
345
-
346
- 1. **Sign conventions matter** - Use NaturalSign to handle debit/credit properly
347
- 2. **Fiscal vs calendar** - Finance always uses fiscal periods
348
- 3. **Variance coloring** - Favorable expenses (under budget) should be green even if negative
349
- 4. **YTD resets** - Use fiscal year start date in TOTALYTD
350
- 5. **Balance sheet** - Point-in-time, not period aggregations
351
- 6. **Drill-through** - Essential for explaining variances