Forecast cashflow month over month based on historical trends by service
Finance needs to perform month over month forecasting of cashflow by extrapolating from historical cash costs. Having this data enables Finance to create cashflow cost models.
Monthly historical billed cost by provider, service category and service, the input to a cash-flow forecast (the query itself does not extrapolate). MONTH() becomes date_trunc('month'); defaults include the March and April 2026 billing periods, but April holds only 37 rows, so the trend is thin.
Monthly billed cost by service category
Chart controls and notes
The largest 7 series keep their own colors; the remaining series are combined as Other.
Query results
Billing month
Provider name
Service category
Service name
Total billed cost
2026-03-01
AWS
Compute
Amazon Elastic Compute Cloud
$499.88
2026-03-01
Microsoft
Compute
Virtual Machines
$168.24
2026-03-01
Microsoft
Databases
Azure SQL Database
$149.04
2026-03-01
Microsoft
Other
SQL Database
$108.73
2026-03-01
AWS
Storage
Amazon Elastic Compute Cloud
$93.56
2026-03-01
AWS
Databases
Amazon Relational Database Service
$65.51
2026-03-01
AWS
Other
Datadog
$40.98
2026-03-01
Microsoft
Web
Azure App Service
$35.98
2026-03-01
AWS
Management and Governance
AmazonCloudWatch
$33.49
2026-03-01
Microsoft
Other
Azure Synapse Analytics
$30.24
2026-03-01
AWS
Networking
Amazon Virtual Private Cloud
$23.15
2026-03-01
Microsoft
Analytics
Microsoft.Fabric
$19.28
2026-03-01
AWS
Networking
Elastic Load Balancing
$18.17
2026-03-01
Microsoft
Storage
Storage Accounts
$17.46
2026-03-01
Oracle
Compute
COMPUTE
$17.31
2026-03-01
Microsoft
Networking
Virtual Network
$12.91
2026-03-01
Microsoft
Developer Tools
Azure Load Testing
$10.00
2026-03-01
AWS
Storage
Amazon Elastic File System
$9.54
2026-03-01
AWS
Other
Amazon Elastic Container Service for Kubernetes
$9.10
2026-03-01
Microsoft
Management and Governance
Azure Monitor
$8.75
2026-03-01
Microsoft
Compute
Azure Kubernetes Service
$8.36
2026-03-01
AWS
Other
Amazon Elastic Container Service
$6.70
2026-03-01
AWS
Storage
Amazon Simple Storage Service
$6.62
2026-03-01
AWS
Management and Governance
AWS Config
$5.51
2026-03-01
Microsoft
AI and Machine Learning
Azure Machine Learning
$5.05
2026-03-01
Microsoft
Compute
Azure Container Instances
$5.02
2026-03-01
Microsoft
Networking
Azure ExpressRoute
$4.19
2026-03-01
AWS
Networking
Amazon CloudFront
$3.86
2026-03-01
AWS
Compute
AWS Lambda
$3.52
2026-03-01
AWS
Other
Red Hat OpenShift Service on AWS
$3.42
2026-03-01
Oracle
Web
OPENSEARCH
$2.60
2026-03-01
Oracle
–
ODSP
$2.49
2026-03-01
AWS
Databases
Amazon ElastiCache
$2.45
2026-03-01
AWS
Compute
Savings Plans for AWS Compute usage
$2.32
2026-03-01
Microsoft
Networking
Azure Private Link
$1.85
2026-03-01
AWS
Databases
Amazon DocumentDB (with MongoDB compatibility)
$1.06
2026-03-01
Microsoft
Other
Load Balancer
$0.72
2026-03-01
Oracle
Compute
OKE_CONTROL_PLANE
$0.70
2026-03-01
Microsoft
Security
Microsoft Defender for Cloud
$0.65
2026-03-01
AWS
Identity
AWS Key Management Service
$0.53
2026-03-01
AWS
Compute
Amazon Elastic Container Registry Public
$0.52
2026-03-01
AWS
Security
Amazon GuardDuty
$0.43
2026-03-01
AWS
Security
AWS Security Hub
$0.43
2026-03-01
AWS
Management and Governance
AWS Systems Manager
$0.42
2026-03-01
AWS
Compute
Amazon Lightsail
$0.34
2026-03-01
AWS
Migration
AWS Transfer Family
$0.30
2026-03-01
AWS
Other
Amazon EC2 Container Registry (ECR)
$0.27
2026-03-01
Oracle
Storage
BLOCK_STORAGE
$0.27
2026-03-01
AWS
Databases
Amazon OpenSearch Service
$0.24
2026-03-01
AWS
Integration
Amazon Simple Queue Service
$0.22
2026-03-01
AWS
Databases
Amazon DynamoDB
$0.22
2026-03-01
AWS
Security
AWS WAF
$0.21
2026-03-01
AWS
Identity
AWS Secrets Manager
$0.20
2026-03-01
Microsoft
Other
Virtual Network
$0.18
2026-03-01
Microsoft
Compute
Azure Container Registry
$0.17
2026-03-01
Microsoft
Storage
Azure Site Recovery
$0.16
2026-03-01
AWS
Compute
AWS Step Functions
$0.16
2026-03-01
AWS
Networking
Amazon API Gateway
$0.13
2026-03-01
Oracle
Others
ORALB
$0.11
2026-03-01
AWS
Business Applications
Amazon Simple Email Service
$0.07
2026-03-01
Oracle
Identity
IDENTITY_AND_ACCESS_MANAGEMENT
$0.06
2026-03-01
AWS
Business Applications
AmazonWorkMail
$0.04
2026-03-01
AWS
Storage
AWS Backup
$0.03
2026-03-01
Microsoft
Security
Key Vault
$0.02
2026-03-01
AWS
Integration
CloudWatch Events
$0.02
2026-03-01
Microsoft
Networking
Azure DNS
$0.02
2026-03-01
AWS
Other
AWS App Runner
$0.00658
2026-03-01
Microsoft
Analytics
Azure Synapse Analytics
$0.00606
2026-03-01
AWS
Networking
Amazon Route 53
$0.00381
2026-03-01
AWS
Developer Tools
AWS X-Ray
$0.0037
2026-03-01
Microsoft
Networking
Application Gateway
$0.00146
2026-03-01
AWS
Management and Governance
AWS CloudTrail
$0.000402
2026-03-01
Microsoft
Integration
Logic Apps
$0.00025
2026-03-01
AWS
Analytics
Amazon Redshift
$0.00018
2026-03-01
AWS
Integration
Amazon Simple Notification Service
$0.0000853
2026-03-01
Microsoft
Integration
Event Grid
$0.0000726
2026-03-01
Oracle
–
ORACLE_STREAMING_SERVICE
$0.0000538
2026-03-01
Microsoft
Integration
Azure Data Factory
$0.00003
2026-03-01
Microsoft
Integration
Service Bus
$0.00000205
2026-03-01
AWS
Storage
Amazon Glacier
$0.000000574
2026-03-01
Oracle
Storage
FILESTORAGESERVICE
$0.00000000002
2026-03-01
AWS
Analytics
Amazon QuickSight
$0.00
2026-03-01
AWS
Analytics
AWS Glue
$0.00
2026-03-01
AWS
Business Applications
Amazon WorkDocs
$0.00
2026-03-01
AWS
Developer Tools
Amazon DevOps Guru
$0.00
2026-03-01
AWS
Management and Governance
AWS CloudFormation
$0.00
2026-03-01
AWS
Web
Amazon Location Service
$0.00
2026-03-01
Microsoft
Compute
Azure Savings Plan for Compute
$0.00
2026-03-01
Microsoft
Developer Tools
App Configuration
$0.00
2026-03-01
Microsoft
Other
Azure App Service
$0.00
2026-03-01
Microsoft
Other
SQL Managed Instance
$0.00
2026-03-01
Microsoft
Storage
Azure File Sync
$0.00
2026-03-01
Oracle
Networking
NETWORK
$0.00
2026-03-01
Oracle
Others
TELEMETRY
$0.00
2026-03-01
Oracle
Storage
OBJECTSTORE
$0.00
2026-03-01
AWS
Networking
AWS Data Transfer
-$0.00957
2026-03-01
Microsoft
Other
Azure Data Factory v2
-$0.04
2026-03-01
Microsoft
Networking
Load Balancer
-$2.11
2026-03-01
Microsoft
Databases
Azure DB for MySQL
-$4.89
2026-03-01
Microsoft
Compute
Virtual Machine Scale Sets
-$12.76
Showing 100 of 108 rows. Scroll inside the table to see more.
Precomputed result
Inspect Postgres SQL and original FOCUS SQL
Postgres SQL, as run
select date_trunc('month', billing_period_start at time zone 'UTC') as billing_month,
provider_name as provider_name,
service_category as service_category,
service_name as service_name,
sum(billed_cost) as total_billed_cost
from focus.cost_and_usage
where billing_period_start >= $1::timestamptz
and billing_period_end < $2::timestamptz
group by 1, 2, 3, 4
order by billing_month, total_billed_cost desc nulls last, provider_name, service_category nulls last, service_name nulls last
limit 500
SELECT
MONTH(BillingPeriodStart),
ProviderName,
ServiceCategory,
ServiceName,
SUM(BilledCost) AS TotalBilledCost
FROM focus_data_table
WHERE BillingPeriodStart >= ? AND BillingPeriodEnd < ?
GROUP BY
MONTH(BillingPeriodStart),
ProviderName,
ServiceCategory,
ServiceName