Find unused calculated fields in a workbook.
Trace calculation dependencies back from worksheet fields before deleting anything. The local inspector shows definitions and worksheet dependency paths; review actions and external uses separately.
Updated
Read locally in this browser.
Which calculation has no worksheet dependency path?
The synthetic sheet uses Net Revenue. Old Revenue is declared but is not referenced by that sheet or another calculation. The result is a review candidate, not a deletion instruction.
“Check which calculation is not used by a worksheet.”
Worked example · authored synthetic data
- Read the original fileUse the existing browser reader
- Check the definitionKeep the grouping and filter scope explicit
- Compute the resultUse the existing xmetric engine
- Review the evidenceRead the exact cells and query
Calculation or query in this example
Net Revenue := SUM([Revenue]) Old Revenue := SUM([Revenue]) * 0.9
Opening the labelled sample…
The browser is reading the sample’s workbook definitions.
Drop one file anywhere on this page. It is read in your browser; no file is uploaded.
Nothing is uploaded.
Read locallyThe original file stays in the browser.
Share deliberatelyMCP shares supported metadata and requested results with the chat host.
Separate actionsOnline saves and support uploads require their own actions.
How does this workflow work?
What is the direct answer to this workbook question?
To find unused calculated fields in a .twb or .twbx workbook, build a dependency graph linking every calculation's internal ID ([Calculation_...]) to the worksheet shelves, filters, parameters, and nested formulas that reference it. Any field with zero downstream references is an orphan. Drop your .twbx into the xmetric inspector to check fields locally.
Why check unused calculated fields before migration?
Production Tableau workbooks accumulate dead weight over years of edits: Sales (copy), Temp_Test_LOD, Old Margin v2, and broken experiments that no worksheet displays.
When your team migrates a .twbx workbook to SQL or dbt, failing to prune unused calculated fields first means you waste hours translating dead formulas that never appear on any dashboard. Worse, materialized extract refreshes can still evaluate unused row-level calculations if they aren't cleaned up.
Why does text search miss nested dependencies?
You cannot find unused fields just by checking if a field's display name appears on a worksheet shelf:
- Internal IDs vs Captions: Inside the
.twbXML, a field namedNet Revenuein the UI is referenced as[Calculation_839201928374]inside other formulas and shelf tags. - Transitive (multi-hop) dependencies:
Calculation Amight not sit on any worksheet shelf directly, butCalculation B(which is on the Columns shelf of Sheet 3) callsCalculation Ainside anIIF()statement. - Hidden shelf usages: A calculated field can be unused on Rows and Columns while still driving a Context Filter, a Sort order, a Tooltip, a Reference Line, or a Color mark.
How can a Python script find unused calculated fields?
Run this script directly or hand it to Claude Code or Cursor to list every true orphan calculation in your workbook:
import re, sys, zipfile
import xml.etree.ElementTree as ET
def find_unused_calcs(path):
if path.endswith(".twbx"):
with zipfile.ZipFile(path) as zf:
twb = [n for n in zf.namelist() if n.endswith(".twb")][0]
xml_text = zf.read(twb).decode("utf-8", errors="ignore")
else:
xml_text = open(path, encoding="utf-8", errors="ignore").read()
root = ET.fromstring(xml_text)
# 1. Collect all calculated fields: internal_name -> caption & formula
calcs = {}
for col in root.findall(".//datasource/column"):
calc = col.find("calculation")
name = col.attrib.get("name")
if calc is not None and name and "formula" in calc.attrib:
calcs[name] = {
"caption": col.attrib.get("caption", name),
"formula": calc.attrib["formula"],
}
# 2. Collect all text in worksheets, dashboards, and actions
ws_text = " ".join(
ET.tostring(el, encoding="unicode")
for el in root.findall(".//worksheets") + root.findall(".//dashboards") + root.findall(".//actions")
)
# 3. Mark directly used calcs, then walk transitive formula dependencies
used = {cid for cid in calcs if cid in ws_text}
changed = True
while changed:
changed = False
for cid in list(used):
formula = calcs[cid]["formula"]
for other_id in calcs:
if other_id not in used and other_id in formula:
used.add(other_id)
changed = True
unused = [
(cid, info["caption"], info["formula"])
for cid, info in calcs.items()
if cid not in used
]
return unused
for cid, caption, formula in find_unused_calcs(sys.argv[1]):
print(f"UNUSED: {caption} ({cid}) -> {formula}")How can I inspect and verify workbook fields in my browser?
Before deleting a list of orphan fields or skipping them in a dbt migration, drop your .twbx or .twb file into the xmetric workbook inspector in your browser:
- See every worksheet, data source, and calculation in one place. The inspector traces what each calculation depends on, shows fields nothing uses, and flags calculations that refer to a missing field. No Tableau Desktop install needed (Tableau offers a free local edition for one person without publishing or sharing, or Tableau Creator at $75 per user/month, billed annually as of October 2026).
- Save packaged data and test formulas locally. Save the data files packaged inside a
.twbx, or run formulas in the formula playground in your browser. Nothing is uploaded. - Agent-ready inspection. The public xmetric MCP server is live at
https://getxmetric.com/mcpwith no authentication or API key. Anonymous initialize, tool discovery and widget-resource checks passed on 2026-10-29. ChatGPT and Claude host rendering and tool selection remain unverified; their directory listings remain coming. Copy the browser inspector output for an unused-field audit; the public MCP catalog does not provide an unused-field audit tool.
What is live, and what remains planned?
The public xmetric MCP server is live at https://getxmetric.com/mcp with no authentication or API key. Anonymous initialize, tool discovery and widget-resource checks passed on 2026-10-29. ChatGPT and Claude host rendering and tool selection remain unverified; their directory listings remain coming. See the dated public protocol receipt and setup and evidence limits.
The public server is available; host operation and directory approval are separate checks.
| Capability | Current status |
|---|---|
| Public remote HTTPS MCP server | Live; anonymous initialize, tools and widget assets checked |
| ChatGPT and Claude host rendering and tool selection | Unverified |
| ChatGPT and Claude directory listings | Coming |
| Live Postgres and BigQuery connections in xmetric | Coming |
The file board parses supported .pbix, .twbx/.twb, CSV, Excel and Parquet files in your browser. Choosing a file shares supported schema, source names and calculation definitions with xmetric and the chat host; requested result cells, filters and SQL or DAX evidence are shared when answering. The original file is not uploaded by this flow. Small aggregates and labels can still be sensitive. Privacy details.
What if a calculated field is only used inside a Dynamic Zone Visibility control or Parameter?
The saved dashboards, datasources and worksheets XML elements can hold such references. Review visibility rules, parameter defaults, actions and external uses before deleting a candidate; a missing worksheet dependency path alone does not prove deletion is safe.
Can I remove unused calculated fields without breaking the .twbx extract?
Yes, deleting a calculation that has zero references in worksheets, dashboards, filters, or other calculations will not affect any chart output. Always keep a backup of the original .twbx file before editing raw XML.
Does xmetric upload my .twbx when I check my calculated fields?
No. xmetric reads .twbx and .twb files locally inside your browser.
Drop your workbook into the xmetric workbook inspector to see which calculated fields nothing uses, or open it in the xmetric app to keep building on it.
What data does this worked example use?
The initial view uses authored synthetic data, not customer data or a captured agent session.
The example record lists its file, calculation or SQL and expected values. The live browser result is computed by xmetric’s existing engine or workbook inspector. Samples are excluded from own-data activation reporting.