Creating Line Graphs

  1. Okay, let’s create a new visualization. We need a new worksheet. Click on the New Worksheet icon at the bottom of the screen. Rename this one to “Line”.

    The New Worksheet icon at the bottom right is outlined with a red box

  2. We’re going to create a line graph now, which is great to show trends over time. We’re going to create a line graph of change in total profit over time. Let’s drag Order Date variable (in the Dimensions section) next to Columns. Next drag the Profit variable (in the Measures section) next to Rows. You’ll notice that our graph is summing Profit automatically.

    Order Date and Profit under the Tables menu are outlined with a red box. YEAR(Order Date) in Columns and SUM(Profit) in Rows above the line graph are outlined with a red box

  3. As we did before, from the drop-down at the top change it from Standard to Entire View.

    The drop-down menu from the top ribbon is outlined with a red box with Entire View highlighted

  4. It might be useful to see this graph broken down by Sub-Category – so basically adding a 3rd variable. The Sub-Category variable is just what it sounds like – a categorical variable, so we can assign different coloured lines for each category to display this information on the graph. To do this in Tableau, you drag Sub-Category (in the Dimensions section, under Product) on to Colour.

    Sub-Category under the Tables menu is outlined with a red box. Color under the Marks card is outlined with a red box

    Tableau has assigned a qualitative colour palette scheme, assigning different colours to represent our Sub-Category, but we do have a lot of them, so it is a bit overwhelming.

    Sub-Category at the top right of the line graph is outlined with a red box

  5. When creating visualizations, you always need to figure out what your main message is. What is the story you are trying to tell. One way to simplify this would be to show a comparison between 2 particular sub-categories of interest. We can do this by dragging Sub-Category over to the Filters shelf.

    Sub-Category under the Tables menu is outlined with a red box. Filters in the centre area is outlined with a red box

    Select two sub-categories. Let’s pick Phones and Tables. (Select None first to clear the selections).

    Phones and Tables are checked off and outlined with red boxes. The None and OK buttons are outlined with red boxes

    This tells a story that Phones are increasing in profit, while Tables are decreasing.

    Quarterly Profit by Sub-Categories (Phones and Tables) are displayed

  6. Another way we could tell a story would be to allow the user to filter it themselves based on what sub-categories they are interested in – so adding an interactive element. To do that, go back to Filters shelf, right click on Sub-Category and pick Edit Filter.

    The Sub-Category drop-down under Filters is outlined with a red box. Edit Filter... from the Sub-Category menu is outlined with a red box

    Select All and click on OK.
    All and OK buttons are outlined with a red box

    Then right click Sub-Category in the Filters shelf again, but this time select Show Filter. Now you can see the Sub-Category filters show up on the right. We can select or deselect as we like and the graph changes. Or select (All) to have them all come back. (if you don’t see the filters, click on Show Me to close its options panel that is blocking the view)

    The Sub-Category drop-down under Filters on the top left is outlined with a red box. Show Filter from the Sub-Category menu is outlined with a red box. Sub-Category with checked categories is outlined with a red box at the top right beside the line graph

  7. To further help the user read your graph, you could also add a Highlighter. Go back to the Filters shelf, right click on Sub-Category, but this time pick Show Highlighter.

    The Sub-Category drop-down under Filters on the top left is outlined with a red box. Show Highlighter from the Sub-Category menu is outlined with a red box. Highlight Sub-Category to the right of the line graph is outlined with a red box

    Now Highlight Sub-Category box shows up on the right. The user can pick a sub-category and the graph emphasizes that Sub-Category – try it out. You should see it emphasized on the graph.

    Highlight Sub-Category and Paper are outlined with a red box to the right of the line graph

  8. Right now it is showing the change in profit over time by years, but we can also change it to display more detail, such as by quarters. One way to do this is to click on the plus sign next to the Year (Order Date) pill next to Columns. This subdivides each year by its quarters.

    The plus sign next to the YEAR(Order Date) in columns at the top is outlined with a red box

    You might see a pattern of end of year growth, cycling over each year, depending on what sub-categories you have selected.

    Quarterly Profit by Sub-Categories bar line graph is shown

  9. Finally, let’s say you didn’t like these colours. Click on the Colour Box and select Edit Colours.

    Color under the Marks card and Edit Colors... are outlined with red boxes

    Here you can pick from a drop-down menu of various colour palettes. Select one you like and click on Assign Palette. Then click on OK.

    Tableau Classic 20, Assign Palette, and OK button are outlined with red boxes

  10. Again, give your graph the title “Quarterly Profit by Sub-Categories”. Lovely!

  11. Quarterly Profit by Sub-Categories bar line graph is shown

Technique: Data Visualization | Tools: Tableau


First created: August 31, 2022
Last updated: June 12, 2026

Tutorial maintained by Kelly Schultz.

Tutorial created by Kelly Schultz.

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International icon