Summary
When downloading data as CSV from a table widget on an AI/BI Dashboard (kebab menu → Download → Data → Download CSV), the column order in the exported file does not match the column order displayed in the dashboard. All aggregated (measure) columns are placed before dimension columns, regardless of how columns are arranged in the widget configuration.
Steps to reproduce
- Create an AI/BI Dashboard with a table widget containing both dimension and measure columns
- Arrange columns in the widget so that dimensions appear before measures (e.g., product_name, product_type, …, SUM(available_stock), sum(reserved_stock))
- Click the kebab menu (⋮) on the widget → Download → Data → Download CSV
- Open the downloaded CSV file and inspect the column headers
Expected behavior
The CSV column order matches the column order configured in the table widget on the dashboard canvas.
Actual behavior
Aggregated columns (sum(...)) are moved to the beginning of the CSV, before all dimension columns. For example:
sum(available_stock), sum(reserved_stock), product_name, product_type, ...
Instead of the dashboard order:
product_name, product_type, ..., sum(available_stock), sum(reserved_stock)
Impact
Users who rely on CSV exports for downstream processing or reporting receive columns in an unexpected order, requiring manual reordering every time. This is particularly disruptive when exports are shared with non-technical stakeholders who expect the CSV to mirror the dashboard layout.
Environment
Databricks AI/BI Dashboards (Lakeview)