In Superset the thing that is closest to a “Calculated field” in QuickSight is either
• a Virtual/Calculated Column that you add to the Dataset definition, or
• an Ad-hoc Metric that you create inside the Explore screen (chart builder).
Both are simply SQL expressions that Superset sends down to the database, so whatever you write must be valid SQL for the underlying engine (Postgres, Snowflake, BigQuery, …).
Below are the two common ways to do it:
──────────────────────────────────────────
Add a Virtual (Calculated) Column to the Dataset
──────────────────────────────────────────
Open the Dataset
Data → Datasets → click the dataset you want.
Edit the Dataset
Top-right corner → Edit Dataset.
Go to the “Columns” tab → “+ Column”.
Fill the dialog
• Column name: revenue_per_user (or whatever)
• SQL expression: SUM(revenue) / NULLIF(SUM(active_users),0)
• Data type: Numeric
• Select “Is dimension” or “Is temporal” only if appropriate.
• (Optional) mark as “Is filterable” so you can later use it in filters.
Save, then hit “Save Dataset & Explore” (or just “Save”) to persist the new column.
The column is now available exactly like any physical column: you can use it in group-bys, select it as a Metric, filter on it, etc.
Screenshot-style recap (text only)
Dataset → Edit → Columns → +Column
Name = revenue_per_user
SQL expr = SUM(revenue) / NULLIF(SUM(active_users),0)
Type = NUMERIC
Save
──────────────────────────────────────────
2. Create an Ad-hoc Metric in a chart
──────────────────────────────────────────
Open or create a chart (Explore view).
In the “Metrics” control click “+ Custom”.
Choose “Simple” or “SQL”. For most use cases pick SQL.
Write your expression, e.g.
code
SUM(revenue) / NULLIF(SUM(active_users),0)
Give it a label (“Revenue per user”) and hit “Save”.
This metric lives only inside that chart (or dashboards you copy it to).
If you want it globally reusable, make it a Dataset-level metric (Settings → Metrics tab) instead.
──────────────────────────────────────────
3. Alternative: build a Custom SQL Dataset
──────────────────────────────────────────
If you have many calculated columns or complex logic, create a dataset off a SQL statement:
Data → + Dataset → pick database → toggle “SQL Query” → paste full SQL with your computed columns → Save.
Everything in the SELECT list becomes a column in the new dataset.
──────────────────────────────────────────
Things to keep in mind
──────────────────────────────────────────
• Superset does NOT compute anything itself; it forwards your expression to the database.
That means you can use any functions that your DB supports (CASE WHEN, DATE_TRUNC, JSON operators, etc.).
• If you change the underlying table schema refresh metadata: Dataset → Actions → Sync columns from source.
• Permissions: a user must have “Edit” rights on the dataset to add virtual columns; chart-only users can still create ad-hoc metrics for their own charts.
• Performance: complex virtual columns run each time the chart queries; materialize them in a view or table if they get slow.
──────────────────────────────────────────
Quick cheat-sheet mapping (QuickSight → Superset)
──────────────────────────────────────────
QuickSight “Calculated field (dataset-level)” → Superset “Virtual Column”
QuickSight “Calculated field (analysis-only)” → Superset “Ad-hoc Metric” (or “Ad-hoc Column” in select list)
That’s all there is to it—your “calculated fields” are just SQL expressions stored on the Dataset or inside the chart. 🎉