<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CSV export from AI/BI Dashboard table widget does not preserve visual column order in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/169806#M56168</link>
    <description>&lt;P&gt;We are having the same problem.&lt;/P&gt;&lt;P&gt;I suspect this could be due to creating a relationship between datasets.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Steps to reproduce:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Create a dashboard with 2 Datasets:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-- Measures
SELECT
  id,
  CAST(MOD(id * 7 + 13, 1000) AS DECIMAL(10, 2)) AS qty1,
  CAST(MOD(id * 11 + 7, 500) AS DECIMAL(10, 2)) AS qty2,
  CAST(MOD(id * 3 + 17, 250) AS DECIMAL(10, 2)) AS qty3
FROM
  RANGE(200000) t(id)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;-- Dimensions
SELECT
  id,
  CONCAT('D', MOD(id, 10)) AS dim01,
  CONCAT('D', MOD(id, 20)) AS dim02,
  CONCAT('D', MOD(id, 30)) AS dim03,
  CONCAT('D', MOD(id, 5)) AS dim04,
  DATE_ADD('2024-01-01', CAST(MOD(id, 365) AS INT)) AS order_date
FROM
  RANGE(200000) t(id)&lt;/LI-CODE&gt;&lt;P&gt;2. Add relationship between datasets:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dimensions.id = Measures.id
-- One to Many&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;3. Add table widget:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;id, dim01, dim02, dim03, dim04, order_date, SUM(qty1), SUM(qty2), SUM(qty3)&lt;/LI-CODE&gt;&lt;P&gt;4. Export the widget as Excel, CSV and TSV. Compare header and data order in each.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Results Found:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;CSV / TSV: Aggregate columns are moved to the front for both header and data.&lt;/LI&gt;&lt;LI&gt;Excel: The header row stays in widget's configured order. But the data order is still aggregates first.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Note: The Excel issue occurs when the query executes against the warehouse during the export.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2026 10:12:02 GMT</pubDate>
    <dc:creator>Akash_Murade</dc:creator>
    <dc:date>2026-09-25T10:12:02Z</dc:date>
    <item>
      <title>CSV export from AI/BI Dashboard table widget does not preserve visual column order</title>
      <link>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/168375#M55912</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Summary&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Steps to reproduce&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create an AI/BI Dashboard with a table widget containing both dimension and measure columns&lt;/LI&gt;&lt;LI&gt;Arrange columns in the widget so that dimensions appear before measures (e.g.,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;product_name,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;product_type, …,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SUM(available_stock), sum(reserved_stock))&lt;/LI&gt;&lt;LI&gt;Click the kebab menu (⋮) on the widget → Download → Data → Download CSV&lt;/LI&gt;&lt;LI&gt;Open the downloaded CSV file and inspect the column headers&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Expected behavior&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The CSV column order matches the column order configured in the table widget on the dashboard canvas.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Actual behavior&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Aggregated columns (sum(...)) are moved to the beginning of the CSV, before all dimension columns. For example:&lt;/P&gt;&lt;P&gt;sum(available_stock), sum(reserved_stock), product_name, product_type, ...&lt;/P&gt;&lt;P&gt;Instead of the dashboard order:&lt;/P&gt;&lt;P&gt;product_name, product_type, ..., sum(available_stock), sum(reserved_stock)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Impact&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Databricks AI/BI Dashboards (Lakeview)&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2026 14:27:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/168375#M55912</guid>
      <dc:creator>Pavel_Sinkevich</dc:creator>
      <dc:date>2026-09-11T14:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export from AI/BI Dashboard table widget does not preserve visual column order</title>
      <link>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/168388#M55917</link>
      <description>&lt;P&gt;I had a go at reproducing this on a current AI/BI build and couldn't get a plain table widget to misbehave. I built a table grouping dimensions plus sum(...) measures, arranged dimensions-first, and the exported CSV kept that order every time.&lt;/P&gt;
&lt;P&gt;I tested three ways: a small result (client-side export), a result over 64,000 rows (which forces the server-side export path), and a case where the widget's query listed the measures first while the display showed dimensions first. In all three the CSV column order matched the screen.&lt;/P&gt;
&lt;P&gt;So the trigger looks specific to your setup rather than table exports in general. A few questions to narrow it down:&lt;/P&gt;
&lt;P&gt;1. Is the widget a plain Table, or a Pivot table (or a table exported with the pivot option)? Pivot exports use a different serialisation path, and there's a known issue there with columns not lining up in the exported file that's being worked on.&lt;BR /&gt;2. How many rows does the table return, and does the download arrive instantly or after a short "preparing" delay?&amp;nbsp;&lt;BR /&gt;3. Did you drag columns to reorder them in the dashboard view before exporting? A reorder in the viewer isn't always saved back to the widget, so the export can fall back to the original order.&lt;BR /&gt;4. Any calculated fields, renamed columns, or conditional formatting on the table?&lt;BR /&gt;5. Which cloud, region, and browser? Export behaviour has shifted across builds, so this helps work out whether it's already been fixed.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2026 16:24:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/168388#M55917</guid>
      <dc:creator>tom_n</dc:creator>
      <dc:date>2026-09-11T16:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export from AI/BI Dashboard table widget does not preserve visual column order</title>
      <link>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/168510#M55932</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;H4&gt;&lt;SPAN&gt;1. Is the widget a plain Table, or a Pivot table?&lt;/SPAN&gt;&lt;/H4&gt;&lt;P&gt;The widget type is Table. When I export the dashboard into a json file, the relevant part looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "widget": {
        "name": "stock-position",
        "queries": [
            {
                "name": "main_query",
                "query": ...
            }
        ],
        "spec": {
            "frame": ...
            "version": 2,
            "widgetType": "table",
            "encodings": {
                "columns": [
                    {
                        "fieldName": "inventory__warehouse"
                    },
...
                    {
                        "fieldName": "sum(inventory__in_stock_quantity)",
                        "displayName": "in_stock_quantity"
                    },
                    {
                        "fieldName": "daily(inventory__best_before_date)"
                    },
...
                ]
            },
            "data": {
                "queryName": "main_query"
            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;And when I click&amp;nbsp;&lt;SPAN&gt;kebab menu (⋮) → View visualization query, the query&amp;nbsp;&lt;/SPAN&gt;for this table looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;WITH `inventory` AS (

# exact copy of the query of dataset "inventory"

)
SELECT
SUM(`inventory`.`in_stock_quantity`) `sum(inventory__in_stock_quantity)`,
...
`inventory`.`warehouse` `inventory__warehouse`,
DATE_TRUNC('DAY', `inventory`.`best_before_date`) `daily(inventory__best_before_date)`,
...
FROM
`inventory`
GROUP BY
`daily(inventory__best_before_date)`,
...
`inventory__warehouse`&lt;/LI-CODE&gt;&lt;P&gt;As you can see, in the visualization query the aggregated columns are listed first, even though they don't go first in the widget definition.&lt;/P&gt;&lt;H4&gt;&lt;SPAN&gt;2. How many rows does the table return&lt;/SPAN&gt;&lt;/H4&gt;&lt;P&gt;&lt;SPAN&gt;Around 170.000&lt;/SPAN&gt;&lt;/P&gt;&lt;H4&gt;&lt;SPAN&gt;3. Did you drag columns to reorder them in the dashboard view before exporting?&lt;/SPAN&gt;&lt;/H4&gt;&lt;P&gt;&lt;SPAN&gt;Yes&lt;/SPAN&gt;&lt;/P&gt;&lt;H4&gt;&lt;SPAN&gt;4. Any calculated fields, renamed columns, or conditional formatting on the table?&lt;/SPAN&gt;&lt;/H4&gt;&lt;P&gt;&lt;SPAN&gt;There are several aggregated columns (using SUM), and datetime columns are converted to date using&amp;nbsp;DATE_TRUNC.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Aggregated columns have custom&amp;nbsp;Display name set in the widget. But I noticed that custom Display name is not showing up in Visualization query.&lt;/SPAN&gt;&lt;/P&gt;&lt;H4&gt;&lt;SPAN&gt;5. Which cloud, region, and browser?&lt;/SPAN&gt;&lt;/H4&gt;&lt;P&gt;&lt;SPAN&gt;Azure,&amp;nbsp;West Europe. The same issue reproduced in Google Chrome and Microsoft Edge.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2026 08:34:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/168510#M55932</guid>
      <dc:creator>Pavel_Sinkevich</dc:creator>
      <dc:date>2026-09-14T08:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export from AI/BI Dashboard table widget does not preserve visual column order</title>
      <link>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/168528#M55936</link>
      <description>&lt;P&gt;I built a copy of your setup on a current workspace and couldn't get it to fail, which is itself a useful clue.&lt;/P&gt;
&lt;P&gt;I matched it fairly closely: a plain table, several SUM measures with custom display names, a date column via DATE_TRUNC, columns dragged so the display shows dimensions first, and around 170,000 rows so the download goes through the large server-side export rather than the in-browser one. The generated visualisation query listed the aggregates first, same as yours. The exported CSV still came out in the display order, dimensions first, not aggregates first. I only moved a column using the UI and that still came out in the correct order.&lt;/P&gt;
&lt;P&gt;NB: the&amp;nbsp;&lt;SPAN&gt;custom Display name is not showing up in Visualization query - this is the same for me.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;So on a current build the export lines up with the on-screen order even in your exact shape. That points to this being specific to your build or region rather than table exports in general, and it may already be fixed on a newer build.&lt;/P&gt;
&lt;P&gt;A few things that would help pin it down:&lt;/P&gt;
&lt;P&gt;1. Run the same export but filtered to well under ~64,000 rows, everything else identical. Does the smaller file come out in the right order (dimensions first), or still aggregates first? And does the small one download instantly while the 170k one shows a "preparing" step? That tells us whether it's tied to the large export path specifically.&lt;BR /&gt;2. Does the same reordering happen in Excel and TSV, or only CSV?&lt;BR /&gt;3. If you set the column order in the query itself so the dimensions come first, rather than only dragging them in the view, does the export then line up? That also works as a stopgap if it does.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2026 13:09:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/168528#M55936</guid>
      <dc:creator>tom_n</dc:creator>
      <dc:date>2026-09-14T13:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export from AI/BI Dashboard table widget does not preserve visual column order</title>
      <link>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/169806#M56168</link>
      <description>&lt;P&gt;We are having the same problem.&lt;/P&gt;&lt;P&gt;I suspect this could be due to creating a relationship between datasets.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Steps to reproduce:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Create a dashboard with 2 Datasets:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-- Measures
SELECT
  id,
  CAST(MOD(id * 7 + 13, 1000) AS DECIMAL(10, 2)) AS qty1,
  CAST(MOD(id * 11 + 7, 500) AS DECIMAL(10, 2)) AS qty2,
  CAST(MOD(id * 3 + 17, 250) AS DECIMAL(10, 2)) AS qty3
FROM
  RANGE(200000) t(id)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;-- Dimensions
SELECT
  id,
  CONCAT('D', MOD(id, 10)) AS dim01,
  CONCAT('D', MOD(id, 20)) AS dim02,
  CONCAT('D', MOD(id, 30)) AS dim03,
  CONCAT('D', MOD(id, 5)) AS dim04,
  DATE_ADD('2024-01-01', CAST(MOD(id, 365) AS INT)) AS order_date
FROM
  RANGE(200000) t(id)&lt;/LI-CODE&gt;&lt;P&gt;2. Add relationship between datasets:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dimensions.id = Measures.id
-- One to Many&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;3. Add table widget:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;id, dim01, dim02, dim03, dim04, order_date, SUM(qty1), SUM(qty2), SUM(qty3)&lt;/LI-CODE&gt;&lt;P&gt;4. Export the widget as Excel, CSV and TSV. Compare header and data order in each.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Results Found:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;CSV / TSV: Aggregate columns are moved to the front for both header and data.&lt;/LI&gt;&lt;LI&gt;Excel: The header row stays in widget's configured order. But the data order is still aggregates first.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Note: The Excel issue occurs when the query executes against the warehouse during the export.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2026 10:12:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/169806#M56168</guid>
      <dc:creator>Akash_Murade</dc:creator>
      <dc:date>2026-09-25T10:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export from AI/BI Dashboard table widget does not preserve visual column order</title>
      <link>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/170015#M56206</link>
      <description>&lt;P&gt;I agree that the&amp;nbsp;&lt;SPAN&gt;relationship between datasets is a likely reason for the issue. I forgot to mention it, but we also have 2 datasets with many-to-one relationship: Orders and Inventory. The table widget is using dataset Inventory, but some of the filter widgets use fields from dataset Orders (such as Order Date).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2026 07:10:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/170015#M56206</guid>
      <dc:creator>Pavel_Sinkevich</dc:creator>
      <dc:date>2026-09-28T07:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export from AI/BI Dashboard table widget does not preserve visual column order</title>
      <link>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/170030#M56215</link>
      <description>&lt;P&gt;This issue occurs if your dashboard has a semantic model attached i.e., you've clicked "Get started with relationships" even if it doesn't have any relationships defined. Just having the semantic model present is enough to trigger it.&lt;/P&gt;&lt;P&gt;The problem is in how the query is generated when a semantic model exists. It puts aggregated columns first, then the other columns after, regardless of the column order configured in the widget.&lt;/P&gt;&lt;P&gt;Workaround: If you're seeing this problem but don't have any relationships set up, check whether a Relationship Graph (Semantic Model) is still attached to the dashboard, and remove it.&amp;nbsp;This thread discusses removing the semantic model: &lt;A href="https://community.databricks.com/t5/warehousing-analytics/how-to-remove-delete-a-relationship-graph-semantic-model-from-an/m-p/165515/highlight/true#M2686" target="_self"&gt;How to remove/delete a Relationship Graph (Semantic Model) from an AI/BI Dashboard&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Hopefully this gets fixed soon.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2026 09:58:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/csv-export-from-ai-bi-dashboard-table-widget-does-not-preserve/m-p/170030#M56215</guid>
      <dc:creator>Akash_Murade</dc:creator>
      <dc:date>2026-09-28T09:58:55Z</dc:date>
    </item>
  </channel>
</rss>

