From 8f05194f1963156180a5273d93336d98eac551be Mon Sep 17 00:00:00 2001 From: Roland Krummenacher Date: Wed, 16 Sep 2026 14:56:55 +0200 Subject: [PATCH 1/3] fix(queries): guard monthly cost change against a zero prior month isempty() is false for 0.0, so the existing guard only covers the first row, where prev() returns null. A month whose prior month summed to exactly zero falls through and KQL evaluates x / 0.0 to inf rather than raising an error, so the result reaches the caller as an infinity. Co-Authored-By: Claude Opus 5 --- src/queries/catalog/monthly-cost-change-percentage.kql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/queries/catalog/monthly-cost-change-percentage.kql b/src/queries/catalog/monthly-cost-change-percentage.kql index 0e36c8fbd..ea4664337 100644 --- a/src/queries/catalog/monthly-cost-change-percentage.kql +++ b/src/queries/catalog/monthly-cost-change-percentage.kql @@ -22,5 +22,5 @@ Costs() | extend PreviousBilledCost = prev(BilledCost) | extend PreviousEffectiveCost = prev(EffectiveCost) | project ChargePeriodStart, - BilledCostChangePct = iff(isempty(PreviousBilledCost), 0.0, toreal((BilledCost - PreviousBilledCost) * 100.0 / PreviousBilledCost)), - EffectiveCostChangePct = iff(isempty(PreviousEffectiveCost), 0.0, toreal((EffectiveCost - PreviousEffectiveCost) * 100.0 / PreviousEffectiveCost)) \ No newline at end of file + BilledCostChangePct = iff(isempty(PreviousBilledCost) or PreviousBilledCost == 0.0, 0.0, toreal((BilledCost - PreviousBilledCost) * 100.0 / PreviousBilledCost)), + EffectiveCostChangePct = iff(isempty(PreviousEffectiveCost) or PreviousEffectiveCost == 0.0, 0.0, toreal((EffectiveCost - PreviousEffectiveCost) * 100.0 / PreviousEffectiveCost)) \ No newline at end of file From d280609f509fb07d56181baa82e70f18a597b000 Mon Sep 17 00:00:00 2001 From: Roland Krummenacher Date: Wed, 16 Sep 2026 15:22:13 +0200 Subject: [PATCH 2/3] docs: add changelog entry for the monthly cost change fix Co-Authored-By: Claude Opus 5 --- docs-mslearn/toolkit/changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs-mslearn/toolkit/changelog.md b/docs-mslearn/toolkit/changelog.md index 767edf7ba..8b0431226 100644 --- a/docs-mslearn/toolkit/changelog.md +++ b/docs-mslearn/toolkit/changelog.md @@ -41,6 +41,7 @@ The following section lists features and enhancements that are currently in deve - Fixed the SQL VMs without Azure Hybrid Benefit recommendation query to join on the SQL VM `virtualMachineResourceId` instead of a case-sensitive VM name match that skipped VMs with uppercase names and dropped duplicate names, and made all Azure Resource Graph join kinds explicit so no query relies on the `innerunique` default ([#2225](https://github.com/microsoft/finops-toolkit/pull/2225)). - Switched dimension enrichment in the v1_0/v1_2 ingestion transforms (`PricingUnits`, `Regions`, `ResourceTypes`, `Services`) from `join` to the broadcast-optimized `lookup` operator and deduplicated the `Services` mapping per resource type to prevent cost row fan-out ([#2225](https://github.com/microsoft/finops-toolkit/pull/2225)). - Fixed the v1_0 and v1_2 price transforms setting `x_CommitmentDiscountSpendEligibility` from reservation meters and `x_CommitmentDiscountUsageEligibility` from savings plan meters, the opposite of the FOCUS `CommitmentDiscountCategory` value the same transform assigns. The spend column now reports savings plan pricing and the usage column reports reservation pricing. Prices ingested after upgrading carry the corrected values; rows ingested earlier keep the old values until they are reingested ([#2279](https://github.com/microsoft/finops-toolkit/issues/2279)). + - Fixed `monthly-cost-change-percentage` returning `inf` when the prior month's cost was exactly zero. The divide-by-zero guard used `isempty()`, which is true for the null that `prev()` returns on the first row but false for `0.0`, and KQL evaluates `x / 0.0` as an infinity rather than raising. A zero prior month is reachable because `BilledCost` is zero on usage rows covered by a commitment discount ([#2323](https://github.com/microsoft/finops-toolkit/issues/2323)). ### [FinOps workbooks](workbooks/finops-workbooks-overview.md) From bae6d5ae5526279a768967b18b97cd277bc9802c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 16 Sep 2026 13:23:18 +0000 Subject: [PATCH 3/3] chore: Update ms.date in docs-mslearn files --- docs-mslearn/toolkit/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-mslearn/toolkit/changelog.md b/docs-mslearn/toolkit/changelog.md index 8b0431226..a3f587fa3 100644 --- a/docs-mslearn/toolkit/changelog.md +++ b/docs-mslearn/toolkit/changelog.md @@ -3,7 +3,7 @@ title: FinOps toolkit changelog description: Review the latest features and enhancements in the FinOps toolkit, including updates to FinOps hubs, Power BI reports, and more. author: MSBrett ms.author: brettwil -ms.date: 09/09/2026 +ms.date: 09/16/2026 ms.topic: reference ms.service: finops ms.subservice: finops-toolkit