Get historical usage and rates to enable cost forecasting
While Finance will look at higher-level forecasting data such as amortized costs and total cashflow, a FinOps Practitioner needs to forecast costs from quantities of priced units and effective costs based on historical rates. Effective costs are used to account for the costs of commitment purchases. This query extracts cost and usage data by Region and Service. More fine-grain extrapolation could be done based on further dimensions like Tags.
- Source
- FOCUS MCP snapshot
- FOCUS editions
- v1.0, v1.1, v1.2
- Queries
- 1
- Mode
- Read-only
- Library snapshot (UTC)
- 2026-10-08
This query uses the ProviderName column. ProviderName is deprecated in v1.3 and will be removed in v1.4.
- Source
- FOCUS 1.0 sample
- Result rows
- 500
- Status
- Runs on sample
- Execution
- Precomputed
- Result snapshot (UTC)
- 2026-10-11
Effective cost by billing period
Showing 100 of 500 rows. Scroll inside the table to see more.
Inspect Postgres SQL and original FOCUS SQL
Postgres SQL, as run
select provider_name as provider_name,
billing_period_start as billing_period_start,
billing_period_end as billing_period_end,
service_category as service_category,
service_name as service_name,
region_id as region_id,
region_name as region_name,
pricing_unit as pricing_unit,
sum(effective_cost) as total_effective_cost,
sum(pricing_quantity) as total_pricing_quantity
from focus.cost_and_usage
where billing_period_start >= $1::timestamptz
and billing_period_end <= $2::timestamptz
group by provider_name, billing_period_start, billing_period_end, service_category, service_name, region_id, region_name, pricing_unit
order by abs(sum(effective_cost)) desc nulls last, billing_period_start, provider_name, service_name, region_id
limit 500Original FOCUS SQL
SELECT ProviderName, BillingPeriodStart, BillingPeriodEnd, ServiceCategory, ServiceName, RegionId, RegionName, PricingUnit, SUM(EffectiveCost) AS TotalEffectiveCost, SUM(PricingQuantity) AS TotalPricingQuantity FROM focus_data_table WHERE BillingPeriodStart >= ? AND BillingPeriodEnd <= ? GROUP BY ProviderName, BillingPeriodStart, BillingPeriodEnd, ServiceCategory, ServiceName, RegionId, RegionName, PricingUnit
Columns used
Column names from the source use case.