Skip to content

Conversation

ZeRego
Copy link
Contributor

@ZeRego ZeRego commented Oct 14, 2025

Related to: lightdash/lightdash#17437
Related to: https://linear.app/lightdash/issue/CENG-77/support-percent-of-total-and-other-post-sql-metric-types-in-looker2dbt

Add Post Calculation Metrics

This PR introduces post calculation metrics, a new experimental feature that allows for computations after aggregate and non-aggregate metrics in a query. Post calculation metrics enable window functions and include three new metric types:

  1. percent_of_previous - Shows the current value as a percentage of the previous row's value
  2. percent_of_total - Calculates the current value as a percentage of the total across the result set
  3. running_total - Computes a cumulative total

Post calculation metrics:

  • Can only reference aggregate and non-aggregate metrics
  • Can be referenced in table calculations
  • Do not support the filters YML property

Examples for each new metric type are included in the documentation with sample YAML configurations.

Screenshot 2025-10-14 at 14 38 44
Screenshot 2025-10-14 at 14 38 53
Screenshot 2025-10-14 at 14 39 09

Copy link
Contributor Author

ZeRego commented Oct 14, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

linear bot commented Oct 14, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant