-
Notifications
You must be signed in to change notification settings - Fork 189
Fix missing CapacityReservationId and CapacityReservationStatus columns in Power BI storage templates #1853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…wer BI storage templates Co-authored-by: MSBrett <[email protected]>
|
Hello Team @MSBrett could you please share tentative ETA on the fix |
docs-mslearn/toolkit/changelog.md
Outdated
|
|
||
| - **Fixed** | ||
| - Fixed tag expansion in Power BI reports when tag names contain special characters like colons. | ||
| - Fixed missing `CapacityReservationId` and `CapacityReservationStatus` columns in storage-based Power BI templates ([#1839](https://github.com/microsoft/finops-toolkit/issues/1839)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Change this to be in the Added section and reword it as added these columns.
| - Fixed missing `CapacityReservationId` and `CapacityReservationStatus` columns in storage-based Power BI templates ([#1839](https://github.com/microsoft/finops-toolkit/issues/1839)). | |
| - Added `CapacityReservationId` and `CapacityReservationStatus` columns in storage-based Power BI reports ([#1839](https://github.com/microsoft/finops-toolkit/issues/1839)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 4c8e4d5. Moved the entry to the Added section under Power BI reports v13 and reworded it to emphasize adding the columns.
Co-authored-by: flanakin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for FOCUS 1.2 CapacityReservationId and CapacityReservationStatus columns to storage-based Power BI reports, addressing a data refresh error in the Power BI Service. The columns are derived from existing data (x_CapacityCommitmentId extracted from VMCapacityReservationId in AdditionalInfo).
Key changes:
- Added Power Query logic to generate CapacityReservationId and CapacityReservationStatus columns
- Updated Power BI table schema to include the new columns
- Documented changes in the changelog
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/power-bi/queries/ftk_NormalizeSchema.pq | Added CapacityReservationId column (mapping from x_CapacityCommitmentId) and CapacityReservationStatus column (with logic to detect "Unused" vs "Used" status) |
| src/power-bi/storage/Shared.Dataset/definition/tables/Costs.tmdl | Added column definitions for CapacityReservationId and CapacityReservationStatus with metadata |
| docs-mslearn/toolkit/changelog.md | Added changelog entry documenting the new columns, plus additional fix entry |
|
|
||
| column CapacityReservationStatus | ||
| dataType: string | ||
| lineageTag: 8b4f5c2d-7g9f-5e0b-c6d2-4f3e5b8a9c0e |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lineageTag value contains an invalid hexadecimal character 'g' in the GUID. LineageTags should be valid UUIDs containing only hexadecimal characters (0-9, a-f). The 'g' in '7g9f' should be replaced with a valid hex character (e.g., '7a9f' or '709f').
| lineageTag: 8b4f5c2d-7g9f-5e0b-c6d2-4f3e5b8a9c0e | |
| lineageTag: 8b4f5c2d-7a9f-5e0b-c6d2-4f3e5b8a9c0e |
| BillingPeriodStart = _swapCol(BillingPeriodEnd, "tmp_BillingPeriodStart", "BillingPeriodStart", each if _isBlank([tmp_BillingPeriodStart]) then Date.StartOfMonth([ChargePeriodStart]) else [tmp_BillingPeriodStart], type date), | ||
| ChargeCategory = Table.AddColumn(BillingPeriodStart, "ChargeCategory", each if _isBlank([tmp_ChargeType]) then "Usage" else if [tmp_ChargeType] = "Usage" or [tmp_ChargeType] = "Purchase" or [tmp_ChargeType] = "Tax" then [tmp_ChargeType] else if Text.StartsWith([tmp_ChargeType], "Unused") then "Usage" else if [tmp_ChargeType] = "Refund" then "Purchase" else "Adjustment"), | ||
| CapacityReservationId = Table.AddColumn(BillingPeriodStart, "CapacityReservationId", each if _isNotBlank([x_CapacityCommitmentId]) then [x_CapacityCommitmentId] else null), | ||
| CapacityReservationStatus = Table.AddColumn(CapacityReservationId, "CapacityReservationStatus", each if _isBlank([CapacityReservationId]) then null else if _isNotBlank([x_ResourceType]) and Text.Lower([x_ResourceType]) = "microsoft.compute/capacityreservationgroups/capacityreservations" then "Unused" else "Used"), |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The column reference [x_ResourceType] is incorrect. According to the column name mapping at line 66, the source column ResourceType is mapped to ResourceType (not x_ResourceType). This will cause an error when the Power Query tries to evaluate this expression because the column x_ResourceType doesn't exist in the table.
The correct column name should be [ResourceType] instead of [x_ResourceType].
| - **Fixed** | ||
| - Fixed tag expansion in Power BI reports when tag names contain special characters like colons. |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tag expansion fix appears twice in the changelog:
- Line 53 under "Implementing FinOps guide v13" section
- Line 95 under "Power BI reports v13" section
Since this is a Power BI-specific fix (based on the context), it should only appear once in the Power BI reports section (line 95), not in the Implementing FinOps guide section. The entry at line 53 should be removed to avoid duplication.
| - **Fixed** | |
| - Fixed tag expansion in Power BI reports when tag names contain special characters like colons. |
| - **Added** | ||
| - Added export requirements sections to all Power BI report documentation pages to clarify which Cost Management exports are needed for each report. | ||
| - Added Azure Resource Graph as an explicit requirement for governance and workload optimization reports. | ||
| - Added `CapacityReservationId` and `CapacityReservationStatus` columns in storage-based Power BI reports ([#1839](https://github.com/microsoft/finops-toolkit/issues/1839)). |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue number in the changelog entry appears to be incorrect. The PR description indicates this fixes issue #1836, but the changelog entry at line 93 references issue #1839. Please verify the correct issue number and update accordingly.
| - Added `CapacityReservationId` and `CapacityReservationStatus` columns in storage-based Power BI reports ([#1839](https://github.com/microsoft/finops-toolkit/issues/1839)). | |
| - Added `CapacityReservationId` and `CapacityReservationStatus` columns in storage-based Power BI reports ([#1836](https://github.com/microsoft/finops-toolkit/issues/1836)). |
Original prompt
Fixes #1836
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.