Understanding Tableau Context Filters

Context filters in Tableau are a big mystery right? In this video I will demonstrate two examples that will help shed some light on how context filters in Tableau work.

When I was starting to learn Tableau, I had no idea why I would ever need to add a filter to the context. It just didn’t make sense for me, because most of the time, the filter still operated in a manner I expected. Little did I know, I was moving a filter on up, to a deluxe apartment in the sky!

That is because I did not understand Tableau’s order of operations. This understanding is key. The higher the filter is on the official order of operations skyscraper, the more influence it has on all the other filters below it.

When two dimension filters are applied to a visual, they are working independently with access to all rows in the data source without regard to other filters. Eventually the filters decide what values they have in common (i.e., the intersection), and those values are shown on a visual.

But if you change your dimension filter to a context filter, you’ve ensured that any other filters that you set are defined as dependent filters because they process only the data that passes through the context filter.

This concept will be very handy when trying to compute the Top N values. Notice on the order of operations that Top N is located below context filters. That means that the Top N filter will only receive values that have been “pre-filtered” from the context filter.

What’s in it for You?

Per Tableau, use context filters to:

  • Improve performance – If you set a lot of filters or have a large data source, the queries can be slow. You can set one or more context filters to improve performance.
  • Create a dependent numerical or Top N filter – You can set a context filter to include only the data of interest, and then set a numerical or a top N filter.

To improve performance of context filters, especially on large data sources, follow these general rules.

  • Using a single context filter that significantly reduces the size of the data set is much better than applying many context filters.
  • In fact, if a filter does not reduce the size of the data set by one-tenth or more, it is actually worse to add it to the context because of the performance cost of computing the context.

Still scratching your head? It will all make sense after the video examples. Give it a watch!

Of course, check out the official documentation from Tableau where I sourced these tips.

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

Do Great Things With Your Data

-Anthony B. Smoak

Photo by Andrea Piacquadio from Pexels

Advertisement

Tableau Dynamic Maps with Parameters: A COVID Dashboard Breakdown

Operation “Reverse Engineer” a Tableau Zen Master dashboard is back in full effect. You know the drill by now, I spent weekend hours analyzing an impressive dashboard put together by Tableau Zen Masters Anya A’Hearn, Tamas Foldi, Allan Walker, and Jonathan Drummey.

In this video I will demonstrate to you how they use parameters to dynamically change the measure that is displayed on both a map and bar chart. Accurate data is made possible through the use of a context filter to equalize the data that is displayed between the United States and all other countries (U.S. data lags by one day).

I should mention that we are using the carefully curated data offered at the Tableau’s COVID-19 Data Hub.

What’s in it for You?

You will learn a neat little trick that encapsulates multiple measures into one calculated field. By using two parameters we can update our visuals to display the correct measure based upon user selected options. This even applies to the size of our marks on a map. You have to love the dynamic nature of Tableau!

In order to understand how we work with the current Tableau COVID-19 data file, you should watch the first video as a prerequisite.

Also Make Sure to Watch this Additional Video Series

Make sure to also check out this extremely useful tutorial on building a COVID-19 Dashboard from scratch. It’s perfect for your first Tableau project with step by step instruction.

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

Do Great Things With Your Data

-Anthony B. Smoak

Build Advanced Tableau KPIs: A COVID-19 Dashboard Breakdown

You want to build an advanced Zen Master level KPI BAN using Tableau’s latest COVID-19 data? Well you’re in luck as I spent a lot of weekend hours analyzing an impressive dashboard put together by Tableau Zen Masters Anya A’Hearn, Tamas Foldi, Allan Walker, and Jonathan Drummey.

Specifically I was intrigued how they put together the KPI BAN from the dashboard below that highlights either NEW or CUMULATIVE Positive cases and the percentage difference from the previous day.

Official Tableau COVID Tracker

The official Tableau COVID-19 tracker database can be found here.

In breaking down their approach I renamed some calculations to better help me organize and understand how they come together to create the KPI.

What’s in it for You?

From a learning standpoint, there is a good mix of parameters, filters, context filters and Level of Detail (LOD) calculations that work in concert to deliver the desired outcome.

In the video you’ll learn how I simplified some of the back-end aspects to be a tad more approachable for beginner to moderate Tableau learners. Of course if you want to see the whole dashboard in context with the original back-end naming conventions and layout you can go download the official workbook and deconstruct it for yourself.

It’s all about learning! I encourage you to make use of workbooks that others have shared for bettering yourself and appreciating skills that are at the next level. Of course, always cite your sources and inspirations!!

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

Make Sure to Watch this Additional Video Series

Make sure to also check out this extremely useful tutorial on building a COVID-19 Dashboard from scratch. It’s perfect for your first Tableau project with step by step instruction.

All views and opinions are solely my own and do NOT necessarily reflect those my employer.

Do Great Things With Your Data

– Anthony B. Smoak

Learn the New Tableau Set Control (Workout Wednesday 2020 Week 20 Solution)

Tableau 2020.2 introduced a handy new feature called set control. According to Tableau:

“The set control allows users to dynamically change the members of a set using a familiar, quick filter-like interface. End users can change set membership with both a single and multi-select dropdown, and the set control automatically refreshes its domain so that the data stays fresh.”

As with all new features I had to figure out what this new capability entailed and how best to learn it. Luckily, the hardworking crew over at Workout Wednesday had the perfect challenge.

Sean Miller (@HipsterVizNinja) created a dashboard that enables the user to select a US state, which then adds that state to a set. Three proportional bar charts update at the top of the viz. A right side bar area displays all of the selected states and selecting a state will remove the state from the set, side bar and the map.

Observe the following gif from my solution:

WOW 2020 Wk 20 GIF

  1. Take a look at the challenge here.
  2. Attempt to re-create the dashboard.
  3. If you give up, (or after you complete your solution), take a look at how I approached the dashboard in this solution video, or take a look at the Tableau Public interactive version here.
  4. Don’t just recopy the steps from this solution and post a viz to LinkedIn and/or Tableau Public. You’re better than that, but if you do, make sure to definitely credit Sean Miller and optionally credit me if you used my approach.

Remember, this is just my approach, there are multiple ways to solve any problem.

This was the first Workout Wednesday challenge that I’ve ever done and I’m sure I’ll tackle a few more.

Do some great things with your data!

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

Anthony B. Smoak

Build a Tableau COVID-19 Dashboard

I hope everyone is safe and staying indoors during this challenging time. Like most of you, I find myself with an abundance of weekend time to spend indoors. I’ve used some of this time crafting a dashboard series leveraging the outstanding COVID-19 data hub provided by Tableau.

I did not expect the series to be as popular as it turned out to be, but it is one of my most viewed lessons on YouTube!

Tableau COVID Dashboard GIF

In this set of videos you will learn how to use Tableau and the Johns Hopkins data set which tracks COVID-19 cases across the globe, to assemble a dashboard. The great part about this dashboard is that it can be put together without reliance on overly complex calculations or the need to be a graphic designer, and it looks amazing if I do say so myself.

This dashboard utilizes the Tableau pages functionality to enable animation; as dates change the dashboard updates to reflect the current number of confirmed cases and deaths at that point in time.

Another cool trick is the use of containers to swap visualizations on the same dashboard. I use this functionality to switch between a linear and logarithmic scale for confirmed cases and deaths. You will need at least Tableau 2019.2 to use the sheet swapping functionality.

The first video provides an overview of the Tableau data-set and touches upon the visualizations required to build out the dashboard.

By popular demand, the second video goes more in-depth on the formatting and color scheme of each of the visualizations.

In my opinion the best part of the series is the 3rd video. I spend a full 93 minutes demonstrating various topics on dashboard refinement.

  1. Eliminating the hard-coding and manual sorts using a level of detail calculated field
  2. Detailed formatting with containers (applicable to all dashboards)
  3. Tableau sheet swapping using containers
  4. Making a Tableau Data Connection

When you get through with the first three videos you can opt for bonus material that teaches you how to implement a “bar chart race” aspect to the countries.

Instead of the same countries remaining static, they will move up and down depending upon the number of cases or deaths associated with a particular date.

Tableau COVID Dashboard Pt4 Gif Proj

Learn the Tableau “bar chart race” effect in Part 4 here:

Feel free to interact with the original viz or the Bar Chart Race version on Tableau public:

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

Build a Power BI Pop Out Slicer

Save more screen for your team! The pop out slicer panel is a perfect way to conserve space while building out your dashboard (i.e., reports) in Power BI desktop. It really is a slick feature that allows you to conserve limited reporting space by hiding your slicers until the user presses a button to reveal your data filtering options.

In this video you can watch me build out the slicer panel step by step using bookmarks, selection panel and buttons.

Power BI Pop Out Slicer (Short GIF)

  • Bookmarks are a configured view of a report page, including filters, slicers, and the state of visuals.
  • The selection panel allows you to show and hide current objects on the current report page.
  • Buttons enable users to hover, click, and further interact with Power BI content

The data sample used for this tutorial is here: https://docs.microsoft.com/en-us/power-bi/sample-financial-download

As always, do great things with your data.

Anthony B. Smoak, CBIP

If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

Check out other Power BI videos of interest definitely worth your time:

All views and opinions are solely my own and do not necessarily reflect those of my employer.

How to Drill Through in Power BI

One of the great options available in Power BI is the capability to “drill through” to another report page. In this manner you can focus on a particular entity such as a customer, internal division, supplier or any other dimension of importance.

Different users have different data needs. When designing a dashboard typically the Key Performance Indicators (KPIs) are aggregated at a high level on the initial visualization. This offers executives and management types a “bird’s eye view” of performance.

Personally, I am a fan of BANs (look up the term in a dashboard design context if you are not familiar) when I want to highlight key takeaways.

BANs

Subsequent lower level dashboard pages can offer analysts and others the ability to either explore data with additional interactivity or simply display a static detailed report. The point is to start at a high level and allow your user to drill to a more granular level of data.

In this video I demonstrate the use of the drill through functionality in Power BI. In this scenario, you are the Chief Supply Chain officer trying to gauge your Perfect Order Percentage KPI for several internal divisions. When it’s time to sit down with your four division mangers to discuss their performance on this metric, you want the ability to start at a high level and then drill through to a static report based upon their respective internal divisions or on a specific shipping error.

DrillThrough

Drill through on “In Full Delivery” error category

Do not try and cram every visualization, chart, table or gauge under the sun into a dashboard! Take advantage of drill through functionality and tailor your data presentation for specific user groups. This general concept applies to any data visualization tool, but if you’re using Power BI then this video will help you understand the specific steps required to enable drill through functionality.

I’m frequently questioned where I obtain mock data for my scenarios. My secret source is mockaroo.com which is a great starting point for developing test data.

As always, do great things with your data.

Anthony B. Smoak, CBIP

If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

Check out other Power BI videos of interest definitely worth your time:

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

How to Create a Dashboard in Tableau

I took the time to produce a dashboard series that would get a relatively new Tableau user up to speed in very little time. I put together the “Goldilocks” videos I wish I had when I was a novice; not too short but long enough to hammer the concepts home.

In the first video, I dive head first into constructing four basic charts that I believe every data user should know how to put together. You will watch me demonstrate how to put together the following charts:

Line Chart with Forecast

Tableau Dashboard Line Chart

The shaded area is a time series forecast predicting the number of orders for the year 2020.

Map

Tableau Dashboard Map

Heat Map

Tableau Dashboard Heat Map

Bar Chart

Tableau Dashboard Bar Chart

In the second video, I’ll cover the layout and formatting of the dashboard, as well as adding a little interactivity. When the user hovers the cursor over the Line Chart, all of the other charts will update to reflect the number of orders represented since the selected month and year.

Full Dashboard

Tableau Dashboard

Watch Part 1 to Build the Component Charts

Watch Part 2 for Layout and Interactivity

What You need:

  • Either Tableau or Tableau Desktop
  • Data set: Tableau Superstore Data (can be found all over the internet with a simple Google search).

Do some great things with your data!

If you find this type of instruction valuable make sure to subscribe to my Youtube channel. All views and opinions are mine alone, independently researched and do not necessarily represent those of my employer.

Tableau Bar Chart: Combining Small Values

In this video we’ll learn how to build a bar chart visualization that combines values below a certain threshold into an “OTHER” bucket. This technique is very useful when limiting the number of bars to show on your visualization while not losing sight of all the smaller values.

  • Using standard Tableau Superstore data, we’ll calculate the percentage of sales that are generated by each individual state.
  • We’ll then use a parameter to set a percentage threshold where all states below this percentage will be combined.
  • This technique also requires the use of sets and Fixed LODs.

This technique allows us to combine all states below a certain threshold (e.g., 2%) into one single bar chart showing a combined 24%.

Bar Chart Below Threshold Thumb 01

I have to give credit where credit is due to Ann Jackson for sharing this technique at TC19!

Feel free to interact with the viz and download the workbook on Tableau public:

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

Build a Stacked Donut Chart in Tableau

Have you ever wanted to stack 4 pie charts on top of each other to build a visual? Let’s have some fun building out a stacked donut chart or a “TrailBlazer” chart as I call it due to its likeness to a particular NBA team’s logo.

Stacked Donut Chart Thumb

Portland Trailblazers anyone?

Stacked Donut vs Trailblazer

In order to build out this chart I used an innovative technique shared by Simon Runc on the Tableau forums. Feel free to check out that post here.

Using Tableau’s Sample Superstore Data, Simon came up with an innovative use of the INDEX() function and the Size functionality to create three different pie charts that each show a respective percentage of a measure (in this case Sales) to the Total amount of the measure.

For example, the chart highlights in red the percentage of Consumer Sales as a percentage of all segment sales (i.e., Consumer + Corporate + Home Office). The grey portions represent all other sales, other than the segment of interest.

The trick to this approach is using the Index function to create a pie chart per segment. For example Consumer is assigned a value of 1, Corporate a value of 2 and Home Office is assigned 3. When the INDEX() value is placed on size, the three different charts are assigned sizes where one is slightly larger than the next.

Stacked Donut Raw 2

With a little division and axis customization, the three segments are placed on top of each other to provide a stacked pie chart effect. The hole is courtesy of the standard methodology for creating a donut chart which involves a dual axis.

It makes much more sense when you see it in action so make sure to watch the video!

Here is an example of the raw stacked donut chart before the “TrailBlazer” formatting.

Stacked Donut Raw

Feel free to interact with the viz and download the workbook on Tableau public:

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

Definitely check out other posts of interest for building donut charts in Tableau:

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.