### How To Create a Gauge Chart in Tableau (UPDATED)

A while back I wrote a post on how to create a gauge chart in Tableau. At the time I felt bad about writing it because I thought it was a bad chart. I have since come around on the gauge. See my previous post on bullets vs gauges for mobile dashboards. And this created some convo on the Twitters about the merits of the gauge. But I think it's an unfairly maligned chart type.
So I think this should be an available chart type to create simply in Tableau. But the old approach I outlined required too much data re-shaping. So at last year's Tableau Conference I presented a new way of creating a gauge that required no data re-shaping. Just a bit of math. Outlined below are updated steps for creating a gauge in Tableau.

For this example I used Superstore Sales; The best damn dummy data set in town. This gauge will show sales by Product Sub-Category relative to one another. So we start with Sub-Category [Sales].

Then we have to normalize sales to put it on a 0 to 1 scale. So I create a new calculated field called [Sales%] using the following formula:

Which converts the scales from dollars to percentages normalized from 0 to 1.

We will use this new field [Sales%] to create the X and Y coordinates which points the gauge needle to a point on the circumference of the gauge. For this gauge I am only using 180 degrees or a semi-circle from 9 o'clock to 3 o'clock on a watch face. Gauge ranges vary. To adjust the angle you simply need to adjust the number 180 in the below calculated field. To create the X and Y calculated fields I use a parametric equation with the [Sales%] field above. For now I am calling these fields [X All] and [Y All]

Sales x 180 essentially creates an angle such that the highest point is at 180 degrees and the lowest at 0 degrees. Now we have the following fields.

When you place [X All] in the columns shelf and [Y All] in the rows shelf then set the calculated field to compute using Sub-Category we get something that looks like this. Beautiful I know. All Sub-Categories are positioned from left to right, lowest to highest sales along the circumference.

But we want a single point for each Product Sub-Category. To do this we will need a parameter to identify the specific point we want to show. So we create a parameter called Sub-Category with the same fields as Product Sub-Category. The fastest way to do this is to right-click on the dimension Sub-Category and select Create > Parameter.

Then we need to tie our X and Y coordinates to this parameter to only show a single point. So we modify the [X] and [Y] measures slightly. In addition to only showing the coordinates of the selected Sub-Category we also need a fixed origin point; in this case 1,1. This places all points not tied to the parameter at the origin point. Which we will use to create the line of the gauge.

Now we have the measures we need. We place the new [X] and [Y] measures into the columns and rows shelves respectively. Then set the calculated field to compute using Sub-Category and set the mark types to line. The new point on the circumference is tied to the parameter and the rest of the points are placed at the origin point (1,1).

We are almost there. Add a background image with shaded reference points setting the X field to X and the Y field to Y. The left is set at 0.5 and right at 2.5. The bottom at 1 and top 2.5  I created this one in PowerPoint using pie charts. This unfortunately makes the context points for the chart stagnant.

Finally, format the Tableau elements as you set fit. I thickened the bar, changed the color, and added a white border. I then added some labels and legends.

I hope this is helpful. Please let me know if you have any questions in the comments below.

1. Thanks a lot for the detailed explanation.. Really Useful. Just a quick question, In my graph i have a used%. Is it possible to show the Used% on a Gauge chart? I mean if i have just 27%, how to show it on the gauge scale without using the parameter?

1. Hello Nani, Were you able to convert this chart to percentage gauge chart without using parameters? I'm trying to achieve percentage gauge chart but not able to figure out X and Y axis calculations.

2. This is amazing. Thank you for a detailed explanation. Just a thought on the calculation of "X All" and "Y All", I think we can remove "* 180" and "/ 180" as they both get terminated. This would reduce the calculation. Please correct me if I am wrong. Cheers

3. Thank for the good topic,Thanks for your sharing.

หนังตลก

4. This comment has been removed by a blog administrator.

1. I am slightly confused about the Angle Field calculation. Can someone please provide the same ?

5. Can anyone tell me how to do a similar gauge chart with multiple needles/pointers in Tableau? I mean in the above gauge chart, I want to show all pointers/needles for all sub-categories without selecting any value in the parameter.

1. This is not possible in this version. Because you need an origin point. The other non-selected points is that origin point. You could modify your data to have a fixed anchor/origin point in your data through a simple union join. Then don't apply any IF THEN filter in the calculation. Hope this helps.

6. Can u tel me how u came up with the angle calculation ?

7. This is really helpful but can someone tell me how the Angle is calculated?

1. The angle is just normalized sales (%) multiplied by total degrees of the gauge or 180. It ultimately is not used in the calc.

2. Hi Adam, we don't understand it clearly. Could you please write bellow the exactly details that we should write to creat the parameter angle? Thanks in advance! Good job by the way! Very helpful.

can you explain give an example of normalized sales (%) multiplied by total degrees of the gauge or 180?
Thanks

8. Hi can u tell me how to configure this chart for a filter.

1. Hi Ravi - What kind of filter? Like region from the super store set?

9. I also need same gauge but with multiple selections e.g in filters

10. This comment has been removed by the author.

11. Hi Adam, really nice work here, thank you! I do however have a question: in my set of data when choosing some parameters, the gauge line disapears and it shows "1 NULL". Is there a problem with my set of data?

12. Hey Adam or anyone else who may be able to answer this,

I have looked at both this blog and http://duelingdata.blogspot.com/2013/05/gauge-hate.html?showComment=1486722314166. I have made my own chart, but it has a problem. Whenever I hover over the starting point, it displays all of the data point's names instead of a nice X:1, Y:1. How can I either get the names to disappear or set 1,1 as the starting point for the x,y coordinate? Any help s greatly appreciated!

13. I cannot get it to work. can you upload the demo file for me, please? thank you so much.

14. I initially tried this without a table calculation and could not use attr(). Error non-aggregate and aggregate don't mix. After creating table calc. When creating x,y coordinates only value in the viz is 2.4 and 1, what am I doing wrong?

1. I tried, but I've got the same error

16. Hi, I'm stuck with this example. My X and Y values don't seem to be correct. I downloaded the public document and it appears I have everything right. Did anyone else run into this?

17. I tried it . It is working for me.In Y instead of using Angle, I used same formula as X and replacing Sin with Cos. Please let me know how to change the needle size.

18. Could you share your book? I'm trying to replicate the "\$73K" but I can't.

19. Thanks for sharing this tableau visualization!

20. Hi there, I'm trying to create a Gauge but to show 12 months within the Gauge. So the Gauge will show 12 slices basically and therfore I could have the Total Sales for the current month that way. Please help if you can...

21. Hi. i want to ask some question, i have 2 or more parameters for this gauge.

the X is like below :

IIF ((ATTR([city])) = [city Parameter] AND
(ATTR([product])) = [product Parameter],
COS( (((1-[sales%])*240)-30) * PI()/180) , 0 )

and the Y :

IIF ((ATTR([city])) = [city Parameter] AND
(ATTR([product])) = [product Parameter],
SIN( (((1-[sales%]) * 240)-30) * PI()/180) , 0 )

the thing is, the dot was missing. is it possible for me to use calculated field with the syntax like that?
thanks before.

cheers

22. why Tableau doesn't create something like Power BI or Qlik for its user, for a few chart types you need to just hope someone else has made it or you wish someone will build it haha

23. i have created calculated field using parameter. need to used that field for gauge chart. my data is in following format. five measure that present five brand. I need to present avg for that five brand measure in single chart by selecting one brand using parameter control. so please suggest how i can create gauge chart

24. can we show average of index multiple variables on gauge chart.using parameter we show single brand index at time on gauge please suggust

25. Hello Sir,
Thanks for this chart!
I have one inputs in this if we drag (-[X]) in size then size of the arrow looks very meaningful, Please try it and let me know if it works

Thanks once again

26. I have created the gauge dashboard and it is looking great but I would like to put a user filter on it now but because it has parameter how would I do this?

27. I am stuck at the "then set the calculated field to compute using Sub-Category we get something that looks like this." How does this work?

28. how can this be created for one metric....i.e. I'm not using subcategories, just one group that I need two different gauge charts for two different metrics. not sure how to get the (1,1) origin line to produce the needle for the gauge

29. Hello,can anyone please tell me that does Tableau requires any kind of calculation?

Tableau Rest Api Connection

30. Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating
Tableau Online Training
Tableau Training

31. Thank you so much for this awesome post. Can you please share the background images used in this Work book please ? We have this requirement to build and need the images. Thanks in advance

32. I would like to replace the straight gauge line with a a real pointer - a bubble at the end and narrowing down if that makes sense. How would I do that

33. this is really great.
can you please advise if we can get interquartile range on same gauge?

34. hi, nice gauge dashboard. one question, where can i find or how to make your gauge_circle.png?

35. Much obliged for sharing this brilliant substance. its extremely fascinating. Numerous web journals I see these days don't actually give whatever pulls in others however the manner in which you have plainly clarified everything it's truly awesome. There are loads of posts But your method of Writing is so Good and Knowledgeable. continue to post such helpful data and view my site too...
How to make a paper airplane | Origami paper plane | how to make a boomerang plane | <a

36. The blog was having very informative content and very useful for me. Well done post and keep it up... Thanks for sharing such a Useful info.tableau automation

37. Thanks for sharing this in here. You are running a great blog, keep up this good work.
Python training
Python online training

38. Thank you so much for the great Blog.
DevOps Training
DevOps Online Training

39. Nice blog, Thanks for sharing with us. Good content and knowledgeable blog.
Data Science Course with Placements in Hyderabad

40. I built a very nice gauge dashboards by following the steps of this blog. It is very useful. However, I would like to ask if I don't want to use sub-category parameter. I want to show gauge for each sub-category. How could I set pointer 1 to make a line? I only get a dot now.

41. Ezy Cash for Cars South Brisbane provides a complete solution for old, scrap, unwanted and damaged cars from \$19999 onward. We are experts in cash for scrap car removal offering unparalleled services to our customers.

div#ContactForm1 { display: none !important; }