#Workoutwednesday wk 31: Dynamic Color Legend

This month is community submission month where each week one of the community submission will be pick for challenge , this week #workoutwednesday challenge is set by Sean Miller and it was about dynamic sheets + dynamic color legends on selection of particular parameter from the dashboard. This dashboard has parameter which will show choropleth map with legends on one selection while bar chart on other selection without legend.

Requirements: 

  • Dashboard size: 800 x 800. Total sheets are part of the challenge.
  • Allow users to select between sales and profit as the measure.
  • The map should have the corresponding measure on color.
  • When the map is active, the color legend and min/max values should show. When subcategory is active the legend and values show be hidden.
  • The color legend should be a stacked bar.
  • The title should update appropriately.

Data for the workout can be downloaded from here

Here is my output for the challenge (Click on Image for interactive version):

It took me time to understand the requirement and figure out the way to design the visualisation. lookup() & windows functions did help a lot to build this requirement

Let me share the steps required to create this visualisation post data is imported into Tableau:

Step 1: Create parameters for the visualisation

View by: For Measure selection

What do you want analyze? : To select State or Sub-category

Step 2: Create an calculated fields required for visualisation

ViewBy: To select the measures on parameter selection

selection: To select the sheet to show or hide on basis of “What do you want to analyze?”

State – Label: This is for max/ min legend

Step 3: Create different sheets for the requirements

Map:

Select State from dimension tab and ViewBy in measures then select Choropleth Map from show me to create the visualisation

Now drag selection field to filter –> select all values –> atmost 1

then right click on both the parameters and select show parameter control with this we have this screen:

Bar: 

Drag Viewby field in column shelf and sub-category to rows shelf then right click both parameters to show parameters control on the sheet. Now, Drag selection field into filter –> select all values –> atleast 2

Legend:

Select State from dimension to column shelf then ViewBy field to color shelf. (unselect show headers)

Now drag selection field to filter –> select all values –> atmost 1

Min:

Select State-Label field and drag to text in the sheet and then set measure value as minimum

Now drag selection field to filter –> select all values –> atmost 1

Max: Repeat same steps like Min sheet just change the measure value to maximum

Step 4: Create the Dashboard

Drag the vertical objects to the blank dashboard then drag Map and Bar sheet to dashboard then align the other 3 sheets (Min, Legend and Max) on the top right side corner below the parameters

Now we are ready with final visualization.

Click here for Tableau file

Thanks Sean Miller for this workout.

Happy Data Visualisation!!!!

Thanks for visiting this post. Please do let me know your feedback or if you have any questions about the blog do not hesitate to contact me on twitter (@Desaimithun)

Do subscribe to Tabvizexplorer.com to keep receive regular updates.