Fix missing CapacityReservationId and CapacityReservationStatus columns in Power BI storage templates #1853
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Users reported errors when refreshing Power BI reports in Power BI Service with the following message:
While the dataset refreshed successfully in Power BI Desktop, it failed in Power BI Service due to missing FOCUS 1.2 specification columns.
Root Cause
The Power BI storage templates were missing two required FOCUS 1.2 columns:
CapacityReservationId- Identifier assigned to VM capacity reservationsCapacityReservationStatus- Status indicating whether the capacity reservation is "Used" or "Unused"According to the FOCUS 1.2 specification, these columns must be present when the provider supports capacity reservations. The KQL-based templates already had these columns, but the storage-based templates were missing them.
Solution
Added both columns to the storage-based Power BI templates:
ftk_NormalizeSchema.pq: Added column transformations following FOCUS conversion rules
CapacityReservationId: Maps fromx_CapacityCommitmentId(extracted fromAdditionalInfo.VMCapacityReservationId)CapacityReservationStatus: Returns null when no ID exists, "Unused" for capacity reservation resources, otherwise "Used"Costs.tmdl: Added column definitions to the Costs table schema for storage-based datasets
The implementation follows the FOCUS conversion guide for mapping Cost Management data to FOCUS format.
Testing
Fixes #1839
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
www.powershellgallery.compwsh -Command ./src/scripts/Build-PowerBI.ps1 CostSummary -Storage(dns block)If you need me to access, download, or install something from one of these locations, you can either:
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.