top of page

Simple Gauge Charts / Speedometer in Tableau (No Custom Data)

Updated: Jun 24, 2020


Visualizing KPIs is the most important part of any dashboard. So I make sure that I have put the best of my efforts into making them look neat and attractive.


In order to show progress KPIs like % Compliance, % Achievement we either use a bar chart or donut chart or BANs (Big-Ass Numbers) and what not, which is good- considering the fact that they use less space and are easy to understand.


Gauge charts are one of the most attractive ways of representing those same KPIs but in a different manner.


Now I know what some of you guys must be thinking-



'We need to create complex table calculations to make that'


'We need to create custom data for it'


'It has a performance impact'



Well not with this method. I have used simple calculations to create the gauge chart.

You just need to follow the following steps:


Step-1: Create a donut

Use dual axes of MIN(0) to create a donut. I am hoping everyone here knows how do do that. In case you don't, you can see ho it's created here.


Creating the base

Step-2: Creating necessary calculations

The % value that I need to show in the gauge, let's call it by the name of the field- Value

eg. SUM(SALES)/SUM(TARGET)

Change the default number format to percentage.


Now, we need to create 8 calculations as follows:


A

IF [Value]<.5 THEN [Value]

ELSE .5

END


B

IF [Value]<.5 THEN .5-[Value] END


C

IF [Value]>.5

THEN [Value]-.5

END


D

IF [Value]>.5 THEN 1-[Value]

ELSE .5

END


E

MIN(1)


Needle1

IF [Value]<=.5 THEN .005 END


Needle2

IF [Value]>.5 THEN .005 END


Dummy

'Dummy'


Easy, right?


Step-3 : Selecting the slices

Put Measure Names into the filter and select these above measures. Dummy will not be in the filter as it is a dimension.



All 7 measures will be selected

Step-4 : Arranging the slices

Put Measure Names into the color and Measure Values into angle for both the inner and outer pies. Now arrange the measure values in the following order from top to bottom:

1. C

2. Needle2

3. D

4. E

5. A

6. Needle1

7. B

Which is going to look something like this:



Now color the slices as follows:

1. Needle1 and Needle2 will be black

2. A and C will be blue

3. B and D will be grey

4. E will be white


You can already see something getting built up like this:


Almost there...

Step-5 : The final touch.

Now for the finale, add the Dummy field into the detail of the inner pie on the marks card. Then click on the detail icon and select color. You will notice that the Measure Names and Dummy have created a temporary combined field to color the inner pie.


Now color the Needle1, Dummy and Needle2, Dummy in black and rest in white.


and with a few tweaking up the label, you will get something like this:



...and viola!! The final product!

You can play around with the value of E to get different results.


You can also refer to the workbook here




Will soon be updating the gauge with the condition based colors.


Hope you enjoyed this one



Keep coming back for more!


Thanks!!! :)


32,948 views22 comments

Recent Posts

See All

22 Comments


I have this issue in every tutorial and it's driving my crazy, I pull over measure values into slices and they all show as a sum except for one - why is this?

Like

I have this issue in every tutorial and it's driving my crazy, I pull over measure values into slices and they all show as a sum except for one - why is this?

Like
Anmol Parimoo
Anmol Parimoo
Jun 03, 2021
Replying to

I'd need to see what measures are getting pulled in.

Like

ukkan tintu
ukkan tintu
Mar 09, 2021

Hi Anmol,


is there any way to style the needle so that a smaller size portion of the needle points to the value?

Like
Anmol Parimoo
Anmol Parimoo
Jun 03, 2021
Replying to

I'd like to see what you're trying to

Like

Hi Anmol -


Great tutorial! It works wonderful!! One question though, is there a way to stop the needle and the calculation when my measure hits 100%? I have a few clients that actually over hit their goal and this messes with the chart. Any suggestion would be appreciated!

Like
Anmol Parimoo
Anmol Parimoo
Jun 03, 2021
Replying to

Technically, yes. But will need to spend some time in order to make it happen.

Like

Thanks a lot for this article, I did same but when i place cursor on chart I don't want to see the borders from chart, I tried all the options of disabling borders but nothing works out, appreciate if any one could help on this.

Like
Replying to

Try this -

1) right click your viz and select "Format"

2) go to "Format Borders"

3) under "Row Divider" look for "Pane"

4) select "Pane" to "None" and that should fix it


Hope it will help!

Like
bottom of page