# Gauge Chart In Tableau

For Corporate Training on Tableau , Power BI , QlikSense , Data Analytics , Data Science , Agile , Scrum SAFe, Pentaho contact us at info@instrovate.com and visit our Website - https://instrovate.com/

Click on the Instrovate Icon to Visit Our Website to see the Comprehensive list of Courses and Consulting that we offer as Corporate , Online & Academic Training and During our Consulting Project works.

If you are new To Data Analytics world and wondering why you should learn Data Visualization or Tableau visit my link that explains the importance of learning Tableau for you Data Analytics Journey - Start Your Analytics Journey - Learn Tableau

If you already Know Tableau lets get started . I had been getting this frequent requirement of creating a Gauge Chart during my several Tableau Training in Gurgaon ; and I like always thought that it is not possible to create one in Tableau, until I came across Adam McCann’s post where he actually explained how to create a Gauge chart in Tableau. He presented with Chris DeMartini at the Tableau Conference in Austin on how to create custom chart types in Tableau and this was one of them. Ever since this has been one visualization which I am fond of .

Let us execute these steps to create a Gauge Chart in Tableau by using Sample Superstore dataset. We will be showing the Sales of various Sub Categories through Gauge Chart.

Step-1:

Show the Sub Category Sales.

Step-2:

We will create a Calculated Field that will normalize the Sales and change the Sales to percentage. The formula will be:

Sales% = SUM([Sales]) / WINDOW_MAX(SUM([Sales]))

Go to the Data pane and right click the field Sales%. Go to Default Properties → Number Format → Percentage. Now this will show the Sales % value in % like below image:

Step-3:

Now, we have to create the Gauge Arch. Since we will create a semi-circle Gauge we will create an Angle field as semi- circle and plot X and Y points.

Create a Calculated field Angle with the following formula:

Angle = Sales% * 180

This will give us the plotting in semi- circle manner and we will use this field for some more calculations. Also, make this as Number Whole from the data pane→ Change Data Type option. When we bring this field to the viz, because it’s a table calculation Compute Using Sub Category.

Create a Calculated field X with the following formula:

X = 1 + SQRT(2) * COS((1-[Sales%])*180 * PI() / 180)

Create another Calculated field Y with the following formula:

Y = 1 + SQRT(2) * SIN([Angle] * PI() / 180)

The  X and Y calculated field created here will be a table calculation; so when we bring it to the sheet we will check Compute Using- Sub Category.

Now, let’s plot X & Y on the sheet with Sub Categories in Detail shelf. Check X & Y field to make it Compute Using→ Sub Category. The viz will look like below:

Step-4:

Create a parameter that will help you choose a Sub Category and plot another Sub Category as origin.

Now add this parameter in previously created X and Y field. For better understanding I have created altogether a new X with parameter and Y with parameter calculated field again.

X with parameter = IIF(ATTR([Sub-Category])=[Parameters].[Sub-Category],

1 + SQRT(2) * COS((1-[Sales%])*180 * PI() / 180),1)

Y with parameter = IIF(ATTR([Sub-Category])=[Parameters].[Sub-Category],

1 + SQRT(2) * SIN([Angle] * PI() / 180),1)

Step-5:

Add X with parameter & Y with parameter in the viz and choose Compute Using -- Sub Category for both the fields.

Drop Sub Category in Detail shelf. The viz will look like below after editing the X axis:

Because we want to show the Sub Categories as a pointer in the gauge; we will change the circles to a line for better formatting, like below:

Step-6:

Add a Background Image in the workbook:

When you click on the data set Name- Orders(Sample- Superstore) in this case, you will get the below dialogue box:

Click on Add Image and then browse for the gauge image.

So, after adding the Background Image the dialogue box looked like below:

Pay extra attention to the highlighted area as those are the changes that you have to make after browsing for the Image in Tableau.

Once done, you will have to Edit X Aix by fixing the Range from -0.5 to 2.5 like below:

Now, the vix looked like below:

Step-7:

Finally, we will do some beutification to finish up the viz. Duplicate thr field Y with parameter that is in Row shelf by dragging another one from the data pane to the row shelf.Once done, you will notice that you have 3 Marks card now. Go to one of the Marks Card for Y with parameter and bring out the Shapes. Choose the shape you want- I choose a Diamond. Then Synchronize your dual axis and hide the Axis that appears on the right side. Put the Parameter, Sales and Sales% field in the Marks Card that shows Shapes.Bring the parameter to sheet by selecting Show Parameter Control. Your Gauge Chart is ready and looks like below:

For Corporate Training on Tableau , Power BI , QlikSense , Data Analytics , Data Science , Agile , Scrum SAFe, Pentaho contact us at info@instrovate.com and visit our Website - https://instrovate.com/

Click on the Instrovate Icon to Visit Our Website to see the Comprehensive list of Courses and Consulting that we offer as Corporate , Online & Academic Training and During our Consulting Project works .

• Sam (Tuesday, June 19 18 06:08 am EDT)

Thank you so much for sharing this. I learned a lot how to implement Gauges is a useful way. Just want to know one more thing, what if we have a smaller semicircle before the big one. I would like to know how the formula works for the X with parameter and Y with parameter. Many thanks for your help in advance.

• Kayla Buck (Tuesday, October 30 18 03:29 pm EDT)

Is there a way to select all parameters?

## Looking for Corporate Training ? Reach out to us at Akriti.Lal@instrovate.com

Reach out to us if you are looking for Corporate Training to Build The Next Generation Analytical Workforce with an in-depth understanding of  Exploratory Data Analysis , Data Visualisation, Data Analytics , AI First , Machine Learning & Deep Learning Training & Consulting helping them to take Data Informed Decision at each stage of the business.

We understand that At the present times , the Entire Industry is in a Tranformation stage with the Softwares  being rebuilt with Artificial Intelligence Capabilities .

We need SMART WORKFORCE for the SMART SOFTWARES to reap the maximum return .

Whatsapp at +91-9953805788 or email at - akriti.lal@instrovate.com if you would like to know more .

• Corporate Tableau Training in Gurgaon
• Corporate Data Analytics Training in Gurgaon
• Corporate Microsoft Power BI Training in Gurgaon
• Corporate Microstrategy Training in Gurgaon
• Corporate Google Data Studio Training in Gurgaon
• Corporate Python Training in Gurgaon
• Corporate Advance Analytics in R Programming Training in Gurgaon
• Corporate Machine Learning Training in Gurgaon
• Corporate Deep Learning Training in Gurgaon
• Corporate Data Visualization Training in Gurgaon

Instrovate Technologies

Noida, Gurgaon

akriti.lal@instrovate.com

Hit Your Refresh Button To Rise Higher