How to Make a Line Graph in Tableau
Tracking changes over time is fundamental to understanding your business, and the line graph is the perfect tool for the job. Whether you're monitoring monthly sales, daily website traffic, or campaign performance, Tableau makes it easy to visualize these trends. This guide will walk you through creating a simple line graph, enhancing it with more detail, and even adding advanced features like forecasting.
What is a Line Graph, and Why Use One in Tableau?
A line graph is a type of chart that displays information as a series of data points called 'markers' connected by straight line segments. Its primary purpose is to show an asset's or a metric's change over a continuous interval or time period. It’s the go-to choice for visualizing time-series data because it clearly illustrates trends, patterns, and fluctuations.
You should use a line graph when you want to:
- Track Performance Over Time: The classic example is tracking sales per month, website sessions per day, or new customers per quarter. The connecting line makes it easy to see upward or downward trends at a glance.
- Compare Multiple Categories Over Time: Want to see how sales for different product categories compare over the last year? A line graph can easily plot multiple lines, each representing a different category, on the same chart for a direct comparison.
- Identify Seasonality and Patterns: A line graph can quickly reveal cyclical trends, like a spike in e-commerce sales every December or a dip in website traffic every weekend.
While a bar chart can also show data over time, a line graph emphasizes the continuity and flow of the data, making it easier to interpret the narrative of how a metric has evolved.
Preparing Your Data for a Line Graph
Before you jump into Tableau, a little data preparation goes a long way. To create a line graph, you need at least two things in your dataset:
- A time-based dimension (e.g., a column with dates or timestamps).
- A numeric measure (e.g., a column with numbers like sales, website visitors, or units sold).
Tableau organizes your data fields into two categories in the Data pane:
- Dimensions: These are qualitative, categorical fields that you use to slice your data. Think of them as the "who, what, where, and when." Examples include Order Date, Product Category, and Customer Name. They are typically colored blue in Tableau.
- Measures: These are quantitative, numerical fields that you can perform mathematical operations on. They are the metrics you want to analyze. Examples include Sales, Profit, and Quantity. They are typically colored green.
For a basic line graph, your simple dataset might just have two columns: Date and Sales. Having this structure makes the process inside Tableau incredibly smooth.
Step-by-Step: Creating a Basic Line Graph in Tableau
Let’s build our first line graph. We'll use a sample dataset to track sales over time.
1. Connect to Your Data
First, open Tableau and connect to your data source. This could be an Excel file, a Google Sheet, a CSV, or a direct connection to a database. Once connected, your dimensions and measures will appear in the Data pane on the left side of your worksheet.
2. Add Your Date and Numeric Fields to the View
This is where Tableau's drag-and-drop interface shines. The main canvas is divided into "shelves" like Columns and Rows.
- Drag your date dimension (e.g., Order Date) from the Data pane and drop it onto the Columns shelf. This will form your horizontal x-axis.
- Drag your numeric measure (e.g., Sales) from the Data pane and drop it onto the Rows shelf. This will form your vertical y-axis.
Tableau is smart enough to recognize that you have a date dimension and a measure, and it will automatically generate a line chart. Just like that, you have a basic visualization showing your sales trend over time!
3. Adjust the Date Granularity
Tableau defaults to showing your date at the highest level of aggregation, which is usually YEAR. This is useful, but you'll almost always want to drill down further. You can easily change the date granularity:
- Click the arrow on the Order Date pill in the Columns shelf.
- In the dropdown menu, you can select Quarter, Month, Week, or Day to change the level of detail.
As you select a different level, like MONTH, your line graph will instantly update to show the new trend. You are now seeing total monthly sales across all years in your data.
Enhancing Your Line Graph for Deeper Insights
A basic line graph is a great start, but the real power of Tableau comes from making your visualizations more detailed and actionable.
Add Multiple Categories Using the "Color" Mark
What if you want to see how sales in different regions contributed to the total? You can split the single line into multiple colored lines, one for each region.
- Simply drag a categorical dimension like Region from the Data pane and drop it onto the Color target in the Marks card. Tableau instantly breaks down the single line into separate lines, assigning a unique color to each region and adding a legend. Now you can quickly compare regional performance over the same time period.
Compare Two Different Measures with a Dual-Axis Chart
Sometimes you need to compare two different measures, like Sales and Profit, which might be on different scales. A dual-axis line chart is perfect for this.
- Start with your first line graph (e.g., Sales over time).
- Drag your second measure (e.g., Profit) and drop it next to the Sales pill on the Rows shelf. You will now have two separate line charts.
- Right-click the new Profit pill and select Dual Axis from the menu.
Tableau will merge the two charts into one, with one measure represented by a left-side y-axis and the other by a right-side y-axis. It’s also a good practice to right-click the right-side axis and select Synchronize Axis if your measures use a similar scale, to ensure a fair comparison.
Filter Your Data for a Focused View
Dashboards often become cluttered. Filters help you and your audience focus on what's most important. You can easily add an interactive filter for any dimension.
- Drag a dimension (like Product Category) to the Filters card.
- A dialog box will appear. Select the categories you want to include in your view and click OK.
- To make this filter interactive for users, right-click the pill in the Filters card and select Show Filter. A filter control will now appear on your dashboard, allowing anyone to turn categories on or off.
Advanced Techniques for Line Graphs
Ready to take your line graphs to the next level? Tableau has powerful built-in analytics features that you can add with a simple drag-and-drop.
Add a Forecast
Tableau can analyze your historical time-series data and generate a forecast to predict future values. Navigate to the Analytics pane (next to the Data pane). Simply drag Forecast from the list and drop it onto your visualization. Tableau automatically projects future trends, complete with a confidence interval.
Add Trend Lines
To better understand the overall direction of your data, you can add a trend line. In the Analytics pane, drag Trend Line onto your view and select the model (Linear, Logarithmic, etc.). This adds a line that shows whether your metric is generally increasing, decreasing, or staying flat over time.
Common Mistakes to Avoid
- Forgetting Context: Always give your chart a clear title and label your axes. No one should have to guess what they are looking at.
- Using Too Many Lines: While comparing a few categories is insightful, adding more than 5-7 lines on a single graph can make it look like a plate of spaghetti and become impossible to read. Use filters to allow users to select which lines they want to see.
- Using it for Non-Categorical Data: Line graphs are designed for continuous data, especially time. If you are comparing distinct, unrelated categories (e.g., sales by country for a single year), a bar chart is a better choice.
Final Thoughts
Building a line graph in Tableau is a fundamental skill for anyone working with data. From a simple drag-and-drop to a multi-layered, interactive visualization with trend lines and forecasts, it’s a powerful tool for uncovering stories hidden in your time-series data. Mastering these steps empowers you to track performance, spot patterns, and make smarter decisions.
While Tableau offers incredible depth, the process of connecting data sources, configuring shelves, and fine-tuning aesthetics still requires manual clicks and a learning curve. For teams that want to move faster, sometimes the best solution is to just ask your data a question and get an answer instantly. We built Graphed to do exactly that — so you can go from raw data to an insightful, real-time dashboard by simply describing what you want to see in plain English. Instead of dragging and dropping, you can get the beautiful, insightful charts you need in seconds, not hours.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?