Building a Cost Explorer Dashboard with Looker Studio and BigQuery
Cloud cost visibility is critical for controlling spend, optimizing resources, and supporting FinOps practices. By combining Google BigQuery and Looker Studio, you can build a scalable, interactive Cost Explorer Dashboard that tracks usage, trends, and anomalies across your cloud environment.
1. Architecture Overview
The typical setup looks like this:
Cloud billing data → exported to BigQuery
BigQuery → stores and aggregates cost data
Looker Studio → visualizes and explores costs
Stakeholders → use dashboards for insights and decisions
This approach is serverless, scalable, and cost-efficient.
2. Exporting Billing Data to BigQuery
Enable Billing Export
In Google Cloud:
Go to Billing → Billing Export
Enable Detailed Usage Cost Export
Choose a BigQuery dataset
This creates tables such as:
gcp_billing_export_v1_*
These tables typically include:
Project ID
Service description
SKU
Usage amount
Cost
Credits
Invoice month
Usage start and end time
3. Understanding the Billing Schema
Key fields to know:
project.id
service.description
sku.description
usage.amount
usage.unit
cost
credits.amount
usage_start_time
invoice.month
Important concept:
Net cost = cost + credits
4. Preparing Cost Data in BigQuery
It’s best to create a cleaned and aggregated view for Looker Studio.
Example: Daily Cost View
CREATE OR REPLACE VIEW billing.daily_costs AS
SELECT
DATE(usage_start_time) AS usage_date,
project.id AS project_id,
service.description AS service,
SUM(cost + IFNULL(credits.amount, 0)) AS net_cost
FROM `your_project.your_dataset.gcp_billing_export_v1_*`,
UNNEST(credits) AS credits
GROUP BY usage_date, project_id, service;
Benefits of using views:
Better performance
Simpler Looker Studio setup
Consistent business logic
5. Connecting BigQuery to Looker Studio
Open Looker Studio
Click Create → Data Source
Select BigQuery
Choose:
Project
Dataset
Table or View
Click Connect
Tip:
Always connect Looker Studio to views, not raw billing tables.
6. Designing the Cost Explorer Dashboard
Key Dashboard Components
6.1 Scorecards (Top KPIs)
Total cost (current month)
Cost vs previous period
Average daily spend
6.2 Time-Series Charts
Daily or monthly cost trends
Cost by service over time
Cost by project over time
6.3 Breakdown Tables
Cost by service
Cost by project
Cost by SKU
6.4 Filters & Controls
Date range
Project selector
Service selector
7. Recommended Visualizations
Use Case Chart Type
Spend trends Time series
Top services Bar chart
Cost distribution Pie or stacked bar
Project comparison Table with conditional formatting
Cost anomalies Line chart with reference lines
8. Cost Optimization Insights
Enhance your dashboard with:
Top N expensive services
Unused or low-usage services
Sudden cost spikes
Month-over-month growth rate
Example calculated field:
MoM Growth % =
(Cost - Previous Month Cost) / Previous Month Cost
9. Performance & Best Practices
BigQuery
Use partitioned tables (by date)
Aggregate data before visualization
Avoid SELECT *
Looker Studio
Limit chart complexity
Use filters instead of multiple charts
Cache data where possible
10. Security & Access Control
Use BigQuery IAM roles for data access
Share Looker Studio dashboards with viewer/editor roles
Mask sensitive fields if needed
Restrict project-level visibility when required
11. Extending the Dashboard
Advanced enhancements:
Budget vs actual tracking
Forecasting future spend
Alerts for cost anomalies
Tag-based cost allocation
Integration with FinOps tools
Final Thoughts
A Cost Explorer Dashboard built with BigQuery and Looker Studio provides:
Real-time cost visibility
Scalable analytics
Self-service exploration
Strong support for FinOps practices
By separating data preparation (BigQuery) from visualization (Looker Studio), you create a robust, maintainable, and business-ready solution.
Learn GCP Training in Hyderabad
Read More
Automating Budget Alerts and Cost Control in GCP
How to Use Cost Tables in BigQuery for FinOps
Cost Optimization & Billing in GCP
Streaming Data from Cloud SQL to BigQuery with Dataflow
Visit Our Quality Thought Training Institute in Hyderabad
Subscribe by Email
Follow Updates Articles from This Blog via Email
No Comments