These days most of my dashboards contains a donut chart.While doing some experiment , my fellow colleague Hendrik Kleine taught me another way of creating a donut chart.So today I am posting a variation on the traditional donut instead. We live in the age of gamification and you'll frequently come across a donut representing a single value, making it a KPI viz. In this post, I'll walk through making such a KPI donut, with a twist, each percentage point (out of a total 100) is displayed distinctly.
Steps to Reproduce:
Create a two column in excel sheet as mentioned below.Connect your tableau with the data Excel file.This data will never change, regardless of the number/Percentage you will want to visualize.
Column Name 1: Category Sort (Contains a number from 1 – 200)
Column Name 2: Color (Contains an alternative Boolean value "True" and "False")
Change the Boolean [Color] from T/F to String and drag [Category Sort] from measure to dimension.
Create a Parameter with a Float data type which should represent the Range of Value from 1 % – 100%. Add Parameter in the View.
Create a Calculated Field as mentioned below.So in the file with the 200 rows there is a True/False Color field. Essentially you have 200 marks around the circle but the False/White ones are serving as structural background pieces to make the segmentation. Here,only the 100 TRUE/Green slices are the ones conveying the %
Create an another calculated Field which should show the Unique Identifier. We have already have a Field in our Dataset "Category Sort" which is a unique result for each of the 200 rows.
Add [Number of Records] to the Rows shelf twice, then change the aggregation to MIN for both.Right-click the second [Number of Records] on the Rows shelf and select Dual Axis and then Synchronize Axis.
Drag your required dimension in the suitable marks card as per the below image.
Note* :Make sure that color calculated Field – "KPI Color" should appear last in the list, as shown in below screenshot.
Double Click on the "KPI Color" and make sure you select a "Green color" for Legend Green, "White" for White and "Light Green" for Light Green. You can also use "Gray" Color in place of "Light Green".Then apply your favorite formatting to complete the job.Your Final viz look like the below image.
Leave a comment
You must be logged into post a comment.