BI & Analytics
Blog
Tableau
8
min read

5 Ways to Level Up Your Bar Chart Using Tableau Parameter Actions

Tableau Parameter Actions are a great feature in Tableau. Read all about it in our latest blog.
Author
Anu Ramachandran
Anu Ramachandran
Analytics Engineer
5 Ways to Level Up Your Bar Chart Using Tableau Parameter Actions
Share article

One of the most awesome things I learned during my first months using Tableau is the broad functionalities of Parameter Actions. Another thing being the importance of a bar chart in an organization. Therefore, I couldn’t be happier that Tableau launched this GAME CHANGER feature in version 2019.2 a couple of months ago, which also means that there are so many things we can do with it that will level up our charting game.

How to level up bar charts in Tableau with Parameter Actions

Nonetheless, thinking out loud on the usability of a new feature is not always easy and thus, learning from the used-cases is the easiest way to learn how to apply this in our data. These are 5 examples of how to use Parameter Actions in a bar chart:

  1. Drill down (displaying different bars)
  2. Drill down (within the same graph)
  3. Labeling
  4. Sorting
  5. Compare Bar Sizes

So let’s dive into the Superstore  data and see the usability of Parameter Actions illustrated using Bar Chart:

1. Drill down (displaying different bars)

This approach enables us to drill down from Category into Sub-Category while showing the full bars for each Sub-Category:

Steps:

  1. Create a Parameter named Parameter: Category or Sub-Category with Data type: String and Allowable values: All

  2. Create a Calculated Field called Category Drilldown as below:

    IF [Parameter: Category or Sub-Category] = [Category]
    THEN [Sub-Category]
    ELSE [Category]
    END

  3. Drag Sales into Column and Category and Category Drilldown into Rows.

  4. Place the Sheet you just made into Dashboard.

  5. Click on Dashboard Tab → Actions → Add Action → Change Parameter.

  6. In Source Sheets: thick your Sheet, in Target Parameter: choose Parameter: Category or Sub-Category, and in Value Field: choose Category Drilldown (Sample - Superstore).

  7. Click Ok, and now you should be able to click one Category and see the bars that represent Sales of each Sub-Category

2. Drill down (within the same bars)

This approach enables us to drill down from Category into Sub-Category while keeping the number of bars based on Category:

Steps:

(skip to the 4th step if you’ve already done the previous section)

  1. Create a Parameter named Parameter: Category or Sub-Category with Data type: String and Allowable values: All
  2. Create a Calculated Field called Category Drilldown as below:

    IF [Parameter: Category or Sub-Category] = [Category]
    THEN [Sub-Category]
    ELSE [Category]
    END

  3. Drag Sales into Column and Category into Rows.

  4. Drag Category Drilldown to Color and Sales to Label in the Marks.

  5. Place the Sheet you just made into Dashboard.

  6. Click on Dashboard Tab → Actions → Add Action → Change Parameter.

  7. In Source Sheets: tick your Sheet, in Target Parameter: choose Parameter: Category or Sub-Category, and in Value Field: choose Category Drilldown (Sample - Superstore).

  8. Click Ok, and now you should be able to click one Category and see the bars that represent Sales of each Sub-Category.

3. Labeling

This approach enables us to hover over a Sub-Category in the bar chart and see its Sales value toward the end of the bar:

Steps:

(skip to the 4th step if you’ve already done the previous section)

  1. Create a Parameter named Parameter: Category or Sub-Category with Data type: String and Allowable values: All
  2. Create a Calculated Field called Category Drilldown as below:

    IF [Parameter: Category or Sub-Category] = [Category]
    THEN [Sub-Category]
    ELSE [Category]
    END

  3. Create a Create a Calculated Field and name it Label Bar Chart as below, and drag it to Label in Marks:

    IF [Parameter: Category or Sub-Category] = [Sub-Category]
    THEN [Sales]
    ELSE NULL
    END

  4. Place the Sheet you just made into Dashboard

  5. Click on Dashboard Tab → Actions → Add Action → Change Parameter

  6. In Source Sheets: thick your Bar Chart Sheet, in Target Parameter: choose Parameter: Category or Sub-Category, and in Value Field: choose Sub-Category (Sample - Superstore)

  7. Click Ok, and now you should be able to hover over a Sub-Category and see the Sales value at the end



4. Sorting

This approach enables us to sort the bar chart based on our chosen measure (Sales or Quantity or Profit):

Steps:

  1. Drag Sales, Quantity, Profit into column and Sub-Category into Rows
  2. Create a Parameter named Parameter: Category or Sub-Category with Data type: String and Allowable values: List. Write Sales, Quantity, and Profit into the list and click Ok
  3. Create a Calculated Field called Sort as below:


    CASE [Parameter: Sort]
    WHEN 'Sales' THEN [Sales]
    WHEN 'Quantity' THEN [Quantity]
    WHEN 'Profit' THEN [Profit]
    END

  4. Click on the down arrow of Sub-Category in Rows and choose Sort

  5. Choose Sort By: Field, Sort Order: Descending, Field Name: Sort, Aggregation: Sum

  6. Make a second Sheet and place Measure Names into Filters, check Sales, Quantity, and Profit

  7. Add Measure Values into Detail and Measure Names into Text in the Marks

  8. Drag Measure Names into the Columns

  9. Add both Sheets into a Dashboard

  10. Click on Dashboard Tab → Actions → Add Action → Change Parameter

  11. In Source Sheets: tick your Sheet with the text and untick the Bar Chart sheet, in Target Parameter: choose Parameter: Sort, and in Value Field: choose Measure Names (Sample - Superstore)

  12. Click Ok, and now you should be able to click on the Sales, Quantity, Profit text and see the bar charts sorted accordingly.

5. Compare Bar Sizes

Sometimes in a bar chart, we would like to maintain the Sort in alphabetical order or based on a specific field. Therefore we should find a way to be able to see the higher or lower performer than our chosen customer without changing the sorting order. With this approach, we will be able to compare the bar when hovering over the Top 10 Customer with the highest sales and see other Customers whose performance is better in terms of Sales.

Steps:

  1. Union Order table from Superstore data with itself

  2. Create a Parameter named Sales Parameter with Data type: Float and Allowable values: All

  3. Create a Calculated Field called Value Above Selected as below:

    SUM([Sales]) - [Sales Parameter]

  4. This field will subtract Sales to the Sales of the chosen Sub-Category in the parameter of your choice later on

  5. Create another Calculated Field named Break Values as below:

IF AVG([Table Value]) < 1THEN (IF avg([Sales Parameter]) <= SUM([Sales])THEN avg([Sales Parameter]) ELSE SUM([Sales])END)

ELSE

(IF [Value Above Selected] > 0 THEN [Value Above Selected]

ELSE 0

END)

END

With a Calculated Field Table Value as:

IF [Table Name] = 'Orders' THEN 0

ELSE 1

END

In this calculation, we are trying to compare the sum of sales of each bar to the bar you selected. With the union table we did on the first stage, this calculation will generate bars that are equal and larger to the Sales value of the Bar you select in the Sales Parameter later on. If the value is less than the parameter of your choice, this calculation will return the value of the bar itself.

Create another Calculated Field named Break Values Label as below:



IF SUM([Table Value]) > 0 AND [Break Values] > 0

THEN [Break Values]

ELSE NULL

END

This field will create a distinction between Bars that have a value less than and bigger than the one you select on the parameter.

  1. Drag the Customer Name to Rows and to Filters card. Choose Condition in the Filter and set to By field: Top 10 based on Sales

  2. Now drag Break Values to Columns

  3. And to the Marks card, drag Table Name to Color, Break Value Labels to Label, and Sales to Tooltip. The reason why we add Sales to tooltip is just that we need to place it somewhere in the view to be able to have control over it in the Parameter Action

  4. Add this sheet into a Dashboard, and add the Parameter Actions by clicking on Dashboard Tab → Actions → Add Action → Change Parameter

  5. Name the Parameter as Compare Bar Chart. Don’t forget to choose Run Action On: Hover. Thick on our previously made sheet in the Source Sheet, and set Target Parameter as Sales Parameter with Value field: SUM(Sales) (Sample - Superstore (2)) and set the Aggregation to SUM

  6. Now in your Dashboard, you should be able to hover to a specific Customer Name and see other customers who have a higher sales

  7. If necessary, you can also add a Reference Line in your sheet by clicking right on your Axis and choose Add Reference Line with Scope: Entire Table, Value: Sales Parameter, and Label: None. Set the Line formatting according to your preference.

Now that you’ve successfully trained yourself using Superstore data, let’s think out of the box and reckon that you might as well implement these examples in different types of graphs using your own data set.

Remember that these 5 examples are not the only ways of making the most out of Parameter Actions. Tableau is an amazing tool that can help you broadly analyze your data. So, if you’re curious to learn more about Parameter Actions and other great stuff Tableau has to offer, or should you be eager to know more about how BI and Analytics can be pivotal in helping your business to grow, contact Biztory and we’ll certainly help you figure it out!

Facts & figures

About client

Testimonial

Blogs you might also like

Everything you need to know about Tableau Certifications

Everything you need to know about Tableau Certifications

Thinking of taking one of the Tableau Certifications? We explore how to get ready in our latest blog. Read all about it here.

BI & Analytics
Blog
Tableau
Personalise your Tableau Dashboard with Custom Titles

Personalise your Tableau Dashboard with Custom Titles

Learn about how to add the personal touch to your Tableau Dashboard with custom titles.

BI & Analytics
Blog
Tableau
Bar Charts: The Good, the Bad, and the Ugly

Bar Charts: The Good, the Bad, and the Ugly

Why can bar charts be effective and how to use them to get answers easier, and faster!

BI & Analytics
Blog
Tableau
How to create a waterfall chart in Tableau

How to create a waterfall chart in Tableau

Learn how to create your own waterfall charts in Tableau Desktop by following these steps.

BI & Analytics
Blog
Tableau
The Ultimate Guide to Embedded Analytics

The Ultimate Guide to Embedded Analytics

Discover what embedded analytics is all about and how it can drive additional revenue streams for your business.

BI & Analytics
Blog
ThoughtSpot
How to label pie charts in Tableau

How to label pie charts in Tableau

Learn more on how to label pie charts in Tableau like a pro.

BI & Analytics
Blog
Tableau
How to label bar charts in Tableau

How to label bar charts in Tableau

Learn how to label bar charts in Tableau like a pro and level up your dashboard design. Read the full article here.

BI & Analytics
Blog
Tableau
How to create a donut chart in Tableau

How to create a donut chart in Tableau

Looking to create a donut chart in Tableau? Read our in-depth guide on how to level up your donut charts in Tableau here.

BI & Analytics
Blog
Tableau
How to ace your ThoughtSpot certifications?

How to ace your ThoughtSpot certifications?

Learn more about ThoughtSpot certifications and how to ace your exams.

BI & Analytics
Blog
ThoughtSpot
How to stop marks being highlighted when ‘clicked’ in Tableau

How to stop marks being highlighted when ‘clicked’ in Tableau

Learn how to stop marks from being highlighted when clicked in Tableau.

BI & Analytics
Blog
Tableau
How to Create Multiple Select Parameters in Tableau

How to Create Multiple Select Parameters in Tableau

Learn how to create multiple select parameters in Tableau to add more control and interactivity to your analysis.

BI & Analytics
Blog
Tableau
How to apply conditional formatting to tooltips in Tableau

How to apply conditional formatting to tooltips in Tableau

Learn how to apply conditional formatting to tooltips in Tableau with our step-by-step guide. Improve your data visualization skills today with Biztory.

BI & Analytics
Blog
Tableau
Rediscovering Business Intelligence with Sigma Computing

Rediscovering Business Intelligence with Sigma Computing

Discover how Sigma Computing is reshaping the BI landscape with its user-friendly interface and powerful capabilities.

BI & Analytics
Blog
Sigma
Sigma Computing: Our Favourite Features

Sigma Computing: Our Favourite Features

Discover our favourite features of Sigma for powerful and fun data analysis.

BI & Analytics
Blog
Sigma
Tableau vs. Power BI: Everything to know

Tableau vs. Power BI: Everything to know

Compare Tableau and Power BI to determine the best business intelligence tool for your needs.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Getting Started (1/3)

Tableau Map Layers: Getting Started (1/3)

Learn how to leverage Tableau's Map Layers feature to create complex visualizations.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Pull everything into one view (3/3)

Tableau Map Layers: Pull everything into one view (3/3)

Use Tableau Map Layers to combine multiple visuals in a single worksheet and create custom dashboard views for enhanced data visualization.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Building Different Charts (2/3)

Tableau Map Layers: Building Different Charts (2/3)

Learn how to create Pie, Doughnut, Line, and Area charts using Tableau Map Layers.

BI & Analytics
Blog
Tableau