MetricFlow is an open-source semantic layer engine designed to help organizations define, manage, and query business metrics in a consistent, governed way. It works alongside a data stack—typically built with dbt—and allows you to express metrics as YAML‐based definitions tied to semantic models and dimension tables, rather than embedding logic ad-hoc across many dashboards or scripts. When a user or tool requests a metric (e.g., “monthly revenue by region”), MetricFlow generates optimized, warehouse-specific SQL to compute that metric, handling joins, filters, time grains, offsets, and other complexities under the hood. Because metric definitions live centrally, you avoid duplication across teams and tools, reduce risk of inconsistent numbers, and make it easier to audit and evolve the logic over time. The project emphasizes explainability, performance and portability: you define metrics once and then they can be consumed in BI tools, notebooks, or even AI/agent-driven workflows.
Features
- Centralized definition of metrics and semantic models in YAML for reuse and consistency
- On-the-fly generation of optimized SQL for different warehouses when a metric is requested
- Support for advanced metric types including ratios, expressions, cumulative, conversions and offset time measures
- Semantic graph modeling: linking semantic models, entities, dimensions and measures so joins and filters are handled automatically
- CLI and integration commands (list metrics, list dimensions, validate configurations, query metrics) for development and CI/CD workflows
- Open-source, vendor-neutral design aimed at portability and governance across BI, analytics, and AI tools