How to Find Duplicates in Tableau
Finding duplicate records in your dataset is one of those unglamorous but necessary tasks in data analysis. If left unchecked, duplicate entries can seriously skew your results, leading to inaccurate counts, inflated totals, and misleading dashboards. This guide will walk you through a couple of reliable methods for identifying duplicates directly within Tableau so you can ensure your analysis is built on clean, trustworthy data.
Why Duplicate Data Skews Your Tableau Reports
Before jumping into the "how," it's important to understand the "why." Duplicate data isn't just a minor annoyance, it actively undermines the integrity of your analytics. When rows of data are repeated, they throw off your calculations in several key ways:
- Inflated Counts and Sums: This is the most obvious impact. If a $500 sale is recorded twice, your total revenue will be off by $500. Metrics like
COUNT()orSUM()will report higher numbers than reality, leading to an overestimation of performance. - Skewed Averages: Averages are calculated by dividing a sum by a count. If both the sum and the count are inflated by duplicates, your averages can be significantly skewed, pointing you toward incorrect conclusions about customer behavior or product performance.
- Misleading Visualizations: In Tableau, your visuals are a direct representation of the underlying data. Duplicates can cause bars on a chart to be taller than they should be, lines to spike incorrectly, and scatter plots to show non-existent clusters of activity.
- Relationship and Join Problems: When blending or joining data sources, duplicates can create a messy web of incorrect relationships. A single customer who appears twice in your customer table might be linked incorrectly to orders, creating a Cartesian product (or "join bomb") that multiplies your rows exponentially.
In short, cleaning duplicates isn't just about tidying up, it's about making sure the story your data tells is the truth. Now, let’s get into the step-by-step methods for finding them.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Method 1: Using COUNT and Number of Records
This is often the quickest and most straightforward way to sniff out duplicates. It works by counting how many times each unique combination of your chosen fields appears. If the count is greater than one, you've found a duplicate.
The key here is deciding which fields, when combined, should define a unique record. For an e-commerce dataset, this might be a combination of Order ID and Product ID. For a CRM dataset, it could be Email Address and Action Date.
Here’s how to set it up:
Step-by-Step Instructions
- Set up your view: Open a new worksheet in your Tableau workbook. Drag the dimensions that are supposed to make up a unique record onto the Rows shelf. For example, if every line item in an order is unique, you might drag
Order IDandProduct IDto Rows. - Add
Number of Records: Tableau automatically generates a measure calledNumber of Records. It's simply a calculated field with a value of1for every row in your data source. FindNumber of Recordsin the Data pane and drag it to the Text mark on the Marks card. By default, Tableau will aggregate this asSUM(Number of Records). - Create a filter to isolate duplicates: To see only the duplicate entries, you can build a simple filter.
- Apply the filter: Drag your new
Is Duplicate?calculated field onto the Filters shelf. A dialog box will pop up. CheckTrueand click OK.
Your view will now be filtered down to show only the combinations of dimensions that appear more than once in your dataset. This gives you a clear list of all your duplicates to investigate.
Method 2: Using Level of Detail (LOD) Calculations
The first method is great, but it has one limitation: it only works for the specific dimensions you have in your view. If you want to create a more flexible check that can be used across different worksheets without being dependent on the visualization's structure, a Level of Detail (LOD) calculation is the perfect tool.
We'll use a FIXED LOD calculation. FIXED computes a value using the specified dimensions, regardless of what dimensions are in the view. We can use this to "fix" our count to the dimensions that define a unique record.
Step-by-Step Instructions
- Create the LOD Calculated Field: First, create a new calculated field. Let’s call it
Occurrence Count (LOD). - Create the duplicate flag: Now, create a second calculated field to use our LOD expression. Name this field
Is Duplicate? (LOD). - Use the LOD fields to find duplicates:
The big advantage here is that the Is Duplicate? (LOD) field is now a portable dimension. You can drop it into any worksheet, and it will correctly flag the duplicate rows without needing to add SUM([Number of Records]) to the view every time. You can use it as a simple filter on your final dashboards to exclude duplicates from all calculations.
Pro Tip: Combine Fields for a Composite Key
Sometimes, a unique record is defined by many fields. Writing a long LOD can be tedious: { FIXED [Field 1], [Field 2], [Field 3], [Field 4] : SUM(1) }. To simplify this, you can first create a calculated field that concatenates all these fields into a single unique "key."
Create a calculated field called Composite Key:
STR([Customer ID]) + "|" + STR([Order ID]) + "|" + STR([Product Name])Then, your LOD calculation becomes much cleaner:
{ FIXED [Composite Key] : SUM([Number of Records]) }Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Okay, I've Found Duplicates. Now What?
Identifying duplicates is only half the battle. Once you've found them, you need a plan to handle them. You have a few options:
- Fix the Data at the Source (Best Option): The ideal solution is to correct the data in the original system (e.g., your CRM, database, or Google Sheet). Tableau is just reporting the data it was given. Fixing it at the source ensures the problem is solved permanently for all users and all future analyses. Use your list of duplicates from Tableau to show your database administrator or data owner exactly where the problems lie.
- Filter them out in Tableau (Good Temporary Fix): If you can't fix the source right away, you can use the
Is Duplicate?boolean filter you created in your Tableau workbook. Apply this filter to all relevant worksheets in your dashboard and set it to exclude theTruevalues. This will hide the duplicates from your visualizations and calculations, allowing you to proceed with your analysis. Just be aware that this is a band-aid - the underlying data is still flawed. - Use a Data Prep Tool: For more complex data cleaning scenarios, a dedicated data preparation tool is your best friend. Tableau Prep Builder is designed for exactly this. You can create a flow in Tableau Prep that connects to your raw data, adds a step to aggregate the data and remove duplicates based on the
Number of Recordslogic, and then outputs a new, clean data source for you to connect to in Tableau Desktop.
Best Practices for Proactive Data Cleaning
To avoid running into the same problems again, try incorporating these habits into your workflow:
- Define Uniqueness: Before you even start building in Tableau, understand your data. Talk with the data owners and establish what fields should constitute a unique record.
- Perform Regular Audits: Make the duplicate check worksheet a standard part of your Tableau workbook templates. Glance at it whenever you connect to a new data source or refresh an existing one.
- Advocate for Data Integrity: Encourage your organization to implement validation rules and constraints in the source systems where data is created. Preventing faulty data from being entered is always easier than cleaning it up later.
Final Thoughts
Dealing with duplicates is a fundamental part of responsible data analysis. By using either the quick SUM([Number of Records]) method or a more robust FIXED LOD calculation, you can easily isolate and understand the extent of duplicate data in your Tableau projects, ensuring every decision is based on accurate numbers.
Manually identifying and filtering duplicates is just one small part of the time-consuming data prep that reporting often requires. At Graphed, we created a tool that removes this friction by automating the entire process from data connection to visualization. When you connect your data sources to Graphed, our AI handles the cleaning and modeling so you can spend your time asking questions in natural language and exploring insights, rather than chasing down duplicate rows or writing calculated fields.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.