mark_ott
Databricks Employee
Databricks Employee

Currently, Databricks dashboards do not support applying a moving average “custom calculation” on top of another custom metric that itself is dynamic with respect to the filters.

Workarounds

  • Segmented SQL Datasets: Pre-compute the filtered sets (as much as possible) in the SQL layer, then apply the moving average calculation there. Pass any possible filter through widgets or parameterize the dataset if business constraints allow.

  • Export and Post-Process: For highly dynamic cases that cannot be handled in the dashboard or SQL alone, export the filtered data (e.g., for a given set of filters), calculate the moving average externally (such as in a Databricks notebook), and visualize that result in the dashboard.

  • Product Wishlist: If true moving average on custom calculations in the dashboard is critical, consider submitting a feature request via official support or community forums. This scenario—window functions on top of dynamic aggregates in dashboards—is a known product limitation

View solution in original post