@microsoft/powerbi-modeling-mcp-linux-arm64 0.5.0-beta.14 → 0.5.0-beta.15

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  The Power BI Authoring MCP Server is a multiplatform application that updates automatically in internal flows. Updates will be released periodically.
4
4
 
5
+ ## [0.5.0-beta.15] - 2026-09-24 - Pre-release
6
+
7
+ ### Fixes
8
+
9
+ - Include new tool metadata in client distributions, which will fix packaging issues
10
+
5
11
  ## [0.5.0-beta.14] - 2026-09-22 - Pre-release
6
12
 
7
13
  ### Features
@@ -0,0 +1,249 @@
1
+ ---
2
+ name: 'Calendar Instructions and Examples'
3
+ description: 'Guidelines for creating Power BI calendar objects'
4
+ uriTemplate: 'resource://calendar_instructions_and_examples'
5
+ ---
6
+ # Calendar Column Groups Guide
7
+
8
+ This guide explains how to define calendar column groups in a Power BI date table so time intelligence works as expected and consistently across models.
9
+
10
+ ## Concepts
11
+
12
+ - Calendar Column Groups. Use these when a primary column represents a standard time unit such as Year, Quarter, Month, Week, or Date. Time units (including "of year" variants) are defined by a fixed enumeration; use the exact casing from the **Allowed time units** list.
13
+ - Time-related groups. Use these for relative columns that are time-aware but are not a standard time unit (for example, RelativeMonth with values like "Current"/"Previous"). They can be used to slice/label time-aware analyses but do not themselves define a standard unit.
14
+ - Primary vs. associated columns. When a column maps to a specific unit, make it the primaryColumn for that unit. If column A is sorted by column B (Power BI SortByColumn), then B should be the primaryColumn and A should be an associatedColumn. Optionally add other 1-to-1 associatedColumns for alternate labels (e.g., a long and a short month name).
15
+
16
+ ## Mapping guidance
17
+
18
+ - Calendar names must be unique across the entire model, not just within a single table. Even though a calendar belongs to a specific table, no two calendars in the model can share the same name.
19
+ - Each calendar definition must use columns from only its host table.
20
+ - Build hierarchies where each level subdivides exactly into the level above: Year → Quarter → Month → Date.
21
+ - For week-based (4-4-5, 4-5-4, 5-4-4, or ISO) calendars, the hierarchy is typically Year → Quarter → Period → Week → Date. Map the Period level to the `Month` time unit, because Period occupies the same hierarchical position between Week/Quarter and Year that Month does in a Gregorian calendar.
22
+ - When using ISO week numbers, always pair them with the corresponding ISO Year — not the Gregorian year. A date in early January may belong to the previous ISO year, and a date in late December may belong to the next ISO year. Mixing ISO weeks with Gregorian years produces incorrect results.
23
+ - Do not repeat a time unit within the same calendar.
24
+ - **Only one time-related group per calendar.** All time-related columns (relative offsets, flags like IsWeekend, FutureDate, etc.) must be combined into a **single** TimeRelated column group. The engine keys column groups by time unit; since all time-related columns share the implicit `Unknown` key, creating multiple separate TimeRelated groups will fail with: *"The CalendarColumnGroup with the key of 'TimeRelated' already exists."* Pass all such columns in one group's column list.
25
+ - A column must map to the same time unit (or as time-related) in every calendar that includes it.
26
+ - Do not use the same physical column more than once in the same calendar.
27
+ - Complete vs. Partial units:
28
+ - Complete units uniquely identify a single period and must include the calendar context (e.g., include the year): Year, Quarter, Month, Week, Date.
29
+ - Examples: 2024 (Year), Q3 2024 (Quarter), 2024-01 or "January 2024" (Month), 2024-W49 (Week), 2024-01-15 (Date).
30
+ - Partial units are positions within a larger period and are not unique by themselves: QuarterOfYear (1–4), MonthOfYear (1–12 or names), WeekOfYear (1–52/53), DayOfYear (1–365/366). Variants exist for Quarter/Month (e.g., MonthOfQuarter).
31
+ - Use these primarily for labels, slicers, or seasonality—not as keys or for hierarchical rollups.
32
+ - Mapping examples:
33
+ - "December 2024" → Month (complete, includes year). "December" → MonthOfYear (not unique across years).
34
+ - "Q3 2023" → Quarter. "Q3" → QuarterOfYear.
35
+ - "2024-W49" or "Week 49 of 2024" → Week. "Week 49" → WeekOfYear.
36
+ - "15th day of month" → DayOfMonth. "15th day of the year" → DayOfYear.
37
+ - Rules of thumb:
38
+ - For standard hierarchies (Year → Quarter → Month → Date), use complete units at every level.
39
+ - You may associate a partial label with a complete primary (e.g., Month primary: Year Month; associated label: MonthOfYear name) if it is 1-to-1 with the primary.
40
+ - Do not map MonthOfYear to Month, WeekOfYear to Week, or QuarterOfYear to Quarter—these are different concepts.
41
+ - For weeks, prefer ISO Year-Week for complete Week labels. If your organization uses a non-ISO week system, still include the year context and use your defined week-numbering convention.
42
+
43
+ ## Allowed time units
44
+
45
+ Time unit values are **case-sensitive enum names**, not natural-language words. Common mistakes:
46
+ - Do **not** pluralize: use `Year`, not `Years`; `Quarter`, not `Quarters`; `Month`, not `Months`.
47
+ - The daily unit is `Date`, not `Day` or `Days`.
48
+ - Compound units use exact PascalCase: `MonthOfYear`, not `MonthOfYear` variants like `monthofyear` or `Month_Of_Year`.
49
+
50
+ The API validates the first column group and rejects the entire request on the first invalid value.
51
+
52
+ ```yaml
53
+ timeUnits:
54
+ - id: Unknown
55
+ example: "IsWeekend"
56
+ note: "Used for all time-related columns (season-type, period-type, flags, etc.)."
57
+ - id: Year
58
+ example: 2022
59
+ - id: Quarter
60
+ example: "Q3 2022"
61
+ - id: QuarterOfYear
62
+ example: 4 # 4th quarter of the year
63
+ - id: Month
64
+ example: "January 2022"
65
+ - id: MonthOfYear
66
+ example: "January"
67
+ - id: MonthOfQuarter
68
+ example: 2 # 2nd month of the quarter
69
+ - id: Week
70
+ example: "2022-W49" # ISO Year-Week or unique year+week label
71
+ - id: WeekOfYear
72
+ example: 49
73
+ - id: WeekOfQuarter
74
+ example: 11
75
+ - id: WeekOfMonth
76
+ example: 3
77
+ - id: Date
78
+ example: "2022-01-01"
79
+ - id: DayOfYear
80
+ example: 241
81
+ - id: DayOfQuarter
82
+ example: 71
83
+ - id: DayOfMonth
84
+ example: 23
85
+ - id: DayOfWeek
86
+ example: 4 # e.g., Thursday if 1=Monday
87
+ ```
88
+
89
+ ## Example
90
+
91
+ ```yaml
92
+ Tables:
93
+ - Name: DimDate
94
+ Columns:
95
+ - Name: Date
96
+ Type: Date
97
+ - Name: Year
98
+ Type: Integer
99
+ - Name: Quarter
100
+ Type: Text
101
+ SortByColumnName: Year Quarter Number
102
+ - Name: Year Quarter
103
+ Type: Text
104
+ SortByColumnName: Year Quarter Number
105
+ - Name: Year Quarter Number
106
+ Type: Integer
107
+ - Name: Month
108
+ Type: Text
109
+ SortByColumnName: Month Number
110
+ - Name: Month Short
111
+ Type: Text
112
+ SortByColumnName: Month Number
113
+ - Name: Month Number
114
+ Type: Integer
115
+ - Name: Year Month
116
+ Type: Text
117
+ SortByColumnName: Year Month Number
118
+ - Name: Year Month Short
119
+ Type: Text
120
+ SortByColumnName: Year Month Number
121
+ - Name: Year Month Number
122
+ Type: Integer
123
+ - Name: Week of Year
124
+ Type: Integer
125
+ - Name: ISO Year-Week
126
+ Type: Text
127
+ SortByColumnName: ISO Year-Week Number
128
+ - Name: ISO Year-Week Number
129
+ Type: Integer
130
+ - Name: Fiscal Year Number
131
+ Type: Integer
132
+ - Name: Fiscal Year Name
133
+ Type: Text
134
+ SortByColumnName: Fiscal Year Number
135
+ - Name: Fiscal Year Month
136
+ Type: Text
137
+ SortByColumnName: Fiscal Year Month Number
138
+ - Name: Fiscal Year Month Number
139
+ Type: Integer
140
+ - Name: Fiscal Month Number of Year
141
+ Type: Integer
142
+ - Name: Fiscal Month Name
143
+ Type: Text
144
+ SortByColumnName: Fiscal Month Number of Year
145
+ - Name: RelativeMonth # Period-type: represents relative states
146
+ Type: Text
147
+ - Name: Season # Season-type: represents cyclical concepts
148
+ Type: Text
149
+ Calendars:
150
+ - name: Gregorian Calendar
151
+ calendarColumnGroups:
152
+ - timeUnit: Year
153
+ primaryColumn: Year
154
+ - timeUnit: Quarter
155
+ primaryColumn: Year Quarter Number
156
+ associatedColumns:
157
+ - Year Quarter
158
+ - timeUnit: Month
159
+ primaryColumn: Year Month Number
160
+ associatedColumns:
161
+ - Year Month
162
+ - Year Month Short
163
+ - timeUnit: Week
164
+ primaryColumn: ISO Year-Week Number
165
+ associatedColumns:
166
+ - ISO Year-Week
167
+ - timeUnit: WeekOfYear
168
+ primaryColumn: Week of Year
169
+ - timeUnit: Date
170
+ primaryColumn: Date
171
+ - name: Fiscal Calendar
172
+ calendarColumnGroups:
173
+ - timeUnit: Year
174
+ primaryColumn: Fiscal Year Number
175
+ associatedColumns:
176
+ - Fiscal Year Name
177
+ - timeUnit: Month
178
+ primaryColumn: Fiscal Year Month Number
179
+ associatedColumns:
180
+ - Fiscal Year Month
181
+ - timeUnit: MonthOfYear
182
+ primaryColumn: Fiscal Month Number of Year
183
+ associatedColumns:
184
+ - Fiscal Month Name
185
+ timeRelatedGroups:
186
+ - column: RelativeMonth
187
+ - column: Season
188
+ ```
189
+
190
+ **API note:** The `timeRelatedGroups` entries above represent individual columns within **one** group, not separate groups. When calling the calendar API, combine them into a single TimeRelated column group: `{"groupType": "TimeRelated", "timeRelatedGroup": {"columns": ["RelativeMonth", "Season"]}}`.
191
+
192
+ ## Week-based (4-4-5 / ISO) calendar example
193
+
194
+ In a week-based calendar, weeks are a proper hierarchical level. Periods replace months and contain a whole number of weeks (e.g., 4, 4, and 5 weeks per quarter in a 4-4-5 pattern). As noted in Mapping guidance, map Period to the `Month` time unit and use the ISO year — not the Gregorian year — as the year column.
195
+
196
+ ```yaml
197
+ Tables:
198
+ - Name: ISO Date
199
+ Columns:
200
+ - Name: Date
201
+ Type: Date
202
+ - Name: ISO Year
203
+ Type: Integer
204
+ - Name: Year-Period
205
+ Type: Integer
206
+ # e.g., 202403 = period 3 of ISO year 2024
207
+ - Name: Year-Week
208
+ Type: Integer
209
+ # e.g., 202449 = week 49 of ISO year 2024
210
+ - Name: Period
211
+ Type: Integer
212
+ # Period number within the year (1-12)
213
+ - Name: ISO Week
214
+ Type: Integer
215
+ # ISO week number (1-53)
216
+ - Name: Week in Period
217
+ Type: Integer
218
+ # Week position within its period (1-4 or 1-5)
219
+ - Name: Day of Week
220
+ Type: Integer
221
+ # 1=Monday through 7=Sunday
222
+ Calendars:
223
+ - name: ISOCalendar445
224
+ calendarColumnGroups:
225
+ - timeUnit: Year
226
+ primaryColumn: ISO Year
227
+ - timeUnit: Month
228
+ # Period maps to Month because it occupies the same
229
+ # hierarchical position between Week and Year
230
+ primaryColumn: Year-Period
231
+ - timeUnit: MonthOfYear
232
+ primaryColumn: Period
233
+ - timeUnit: Week
234
+ primaryColumn: Year-Week
235
+ - timeUnit: WeekOfYear
236
+ primaryColumn: ISO Week
237
+ - timeUnit: Date
238
+ primaryColumn: Date
239
+ timeRelatedGroups:
240
+ - column: Week in Period
241
+ - column: Day of Week
242
+ ```
243
+
244
+ **Notes on week-based calendars and time intelligence:**
245
+ - With a custom calendar defined this way, standard DAX time intelligence functions (DATESYTD, DATESMTD, DATESWTD, SAMEPERIODLASTYEAR, DATEADD) automatically adapt to the week-based hierarchy.
246
+ - DATESMTD returns period-to-date results (since Period is mapped to Month).
247
+ - DATESWTD returns week-to-date results.
248
+ - SAMEPERIODLASTYEAR shifts to the same week number and day-of-week in the previous ISO year, which ensures that comparisons always cover the same number of days.
249
+ - DATEADD supports Extension (Precise or Extending) and Truncation (Anchored or Blanks) parameters to handle shifts between periods of different lengths (e.g., 4-week vs. 5-week periods).