Skip to content

Commit e88abc5

Browse files
CopilotMSBrettflanakin
authored
Fix missing CapacityReservationId and CapacityReservationStatus columns in Power BI storage templates (#1853)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MSBrett <24294904+MSBrett@users.noreply.github.com> Co-authored-by: Michael Flanakin <flanakin@users.noreply.github.com> Co-authored-by: flanakin <399533+flanakin@users.noreply.github.com>
1 parent ff23be5 commit e88abc5

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

‎docs-mslearn/toolkit/changelog.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: FinOps toolkit changelog
33
description: Review the latest features and enhancements in the FinOps toolkit, including updates to FinOps hubs, Power BI reports, and more.
44
author: MSBrett
55
ms.author: brettwil
6-
ms.date: 02/24/2026
6+
ms.date: 02/25/2026
77
ms.topic: reference
88
ms.service: finops
99
ms.subservice: finops-toolkit
@@ -127,6 +127,7 @@ _Released January 2026_
127127
- **Added**
128128
- Added export requirements sections to all Power BI report documentation pages to clarify which Cost Management exports are needed for each report.
129129
- Added Azure Resource Graph as an explicit requirement for governance and workload optimization reports.
130+
- Added `CapacityReservationId` and `CapacityReservationStatus` columns in storage-based Power BI reports ([#1836](https://github.com/microsoft/finops-toolkit/issues/1836)).
130131
- **Fixed**
131132
- Fixed tag expansion when tag names contain special characters like colons.
132133
- Fixed unattached disks count in the workload optimization report to show only truly unattached disks ([#1896](https://github.com/microsoft/finops-toolkit/issues/1896)).

‎src/power-bi/queries/ftk_NormalizeSchema.pq‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ let
287287
BillingAccountType = Table.AddColumn(BillingAccountName, "BillingAccountType", each if [x_AccountType] = "MCA" then "Billing Profile" else if [x_AccountType] = "EA" then "Billing Account" else "Subscription"),
288288
BillingPeriodEnd = _swapCol(BillingAccountType, "tmp_BillingPeriodEnd", "BillingPeriodEnd", each if _isMissing("tmp_BillingPeriodEnd") then Date.StartOfMonth(Date.AddDays([ChargePeriodStart], 31)) else Date.AddDays([tmp_BillingPeriodEnd], 1), type date),
289289
BillingPeriodStart = _swapCol(BillingPeriodEnd, "tmp_BillingPeriodStart", "BillingPeriodStart", each if _isBlank([tmp_BillingPeriodStart]) then Date.StartOfMonth([ChargePeriodStart]) else [tmp_BillingPeriodStart], type date),
290-
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"),
290+
CapacityReservationId = Table.AddColumn(BillingPeriodStart, "CapacityReservationId", each if _isNotBlank([x_CapacityCommitmentId]) then [x_CapacityCommitmentId] else null),
291+
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"),
292+
ChargeCategory = Table.AddColumn(CapacityReservationStatus, "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"),
291293
ChargeClass = Table.AddColumn(ChargeCategory, "ChargeClass", each if [tmp_ChargeType] = "Refund" then "Correction" else null),
292294
ChargeDescription = Table.AddColumn(ChargeClass, "ChargeDescription", each [x_SkuDescription]),
293295
// TODO: PricingQuantity,SkuId,SkuPriceId

‎src/power-bi/storage/Shared.Dataset/definition/tables/Costs.tmdl‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,22 @@ table Costs
804804

805805
annotation PBI_FormatHint = {"isCustom":true}
806806

807+
column CapacityReservationId
808+
dataType: string
809+
lineageTag: 7a3e4b1c-6f8e-4d9a-b5c1-3e2f4a7b8c9d
810+
summarizeBy: none
811+
sourceColumn: CapacityReservationId
812+
813+
annotation SummarizationSetBy = Automatic
814+
815+
column CapacityReservationStatus
816+
dataType: string
817+
lineageTag: 8b4f5c2d-7a9f-5e0b-c6d2-4f3e5b8a9c0e
818+
summarizeBy: none
819+
sourceColumn: CapacityReservationStatus
820+
821+
annotation SummarizationSetBy = Automatic
822+
807823
column ChargeCategory
808824
dataType: string
809825
lineageTag: 669cea79-1e27-46c1-a88f-0ad859cee094

0 commit comments

Comments
 (0)