This query uses the ProviderName column. ProviderName is deprecated in v1.3 and will be removed in v1.4.

Personas
FinOps Practitioner
Capabilities
Rate Optimization, Planning & Estimating
KPIs
Percentage of Commitment Discount Waste, Effective Savings Rate Percentage, Effective Average Compute Cost per Core, Percent of Compute Spend Covered by Commitment Discounts
Source
FOCUS 1.0 sample
Result rows
1
Status
Runs on sample
Execution
PrecomputedRead-only
Result snapshot (UTC)
2026-10-11

Commitment discounts with unused (CommitmentDiscountStatus = Unused) charges and their billed and effective cost. The sample has a single unused row (a Microsoft savings plan) with zero cost. commitment_label (name, or the last segment of the ID) is added for readable chart labels.

Unused commitment cost

Query results
Charge period startCharge period endProvider nameBilling account idCommitment discount idCommitment labelCommitment discount typeCommitment discount statusTotal billed costTotal effective cost
2026-03-172026-03-18Microsoft/providers/Microsoft.Billing/billingAccounts/8611537/providers/Microsoft.BillingBenefits/savingsPlanOrders/802a9e8b-e860-4d5f-b63b-c5bdf7ee2446/savingsPlans/09ff8291-64ac-45fb-afed-b9b39dbd88d7Compute_SavingsPlan_11-07-2022_09-55Savings PlanUnused$0.00$0.00

1 row. Scroll inside the table to see more.

Precomputed result

Inspect Postgres SQL and original FOCUS SQL

Postgres SQL, as run

select min(charge_period_start) as charge_period_start,
       max(charge_period_end) as charge_period_end,
       provider_name,
       billing_account_id,
       commitment_discount_id,
       coalesce(max(commitment_discount_name), regexp_replace(commitment_discount_id, '^.*/', '')) as commitment_label,
       commitment_discount_type,
       commitment_discount_status,
       sum(billed_cost) as total_billed_cost,
       sum(effective_cost) as total_effective_cost
from focus.cost_and_usage
where charge_period_start >= $1::timestamptz
  and charge_period_end < $2::timestamptz
  and commitment_discount_status = 'Unused'
group by provider_name, billing_account_id, commitment_discount_id, commitment_discount_type, commitment_discount_status
order by total_effective_cost desc nulls last, provider_name, commitment_discount_id
limit 500

Parameters: $1 = period_start, $2 = period_end

Original FOCUS SQL

SELECT
  MIN(ChargePeriodStart) AS ChargePeriodStart,
  MAX(ChargePeriodEnd) AS ChargePeriodEnd,
  ProviderName,
  BillingAccountId,
  CommitmentDiscountId,
  CommitmentDiscountType,
  CommitmentDiscountStatus,
  SUM(BilledCost) AS TotalBilledCost,
  SUM(EffectiveCost) AS TotalEffectiveCost
FROM focus_data_table
WHERE ChargePeriodStart >= ? AND ChargePeriodEnd < ?
  AND CommitmentDiscountStatus = 'Unused'
GROUP BY
  ProviderName,
  BillingAccountId,
  CommitmentDiscountId,
  CommitmentDiscountType,
  CommitmentDiscountStatus

Columns used

Column names from the source use case.

  • Provider Name
  • Billing Account ID
  • Commitment Discount ID
  • Commitment Discount Type
  • Billed Cost
  • Charge Period Start
  • Charge Period End
  • Effective Cost
  • Commitment Discount Status
Read the source on focus.finops.org ↗