So… you want to write fast calculations in Tableau Desktop? Me too.

Our blog will help you;

  1. make your dashboards faster
  2. easier to support
  3. and not too challenging for the next data guru

If this is too easy, please check out our analytics automation training at!

Writing Tableau Desktop calculations correctly, may feel like a bit of a foreign language …

Writing Tableau Desktop calculations correctly, may feel like a bit of a foreign languag for most people, however once you get rid of the old habits and learn the correct way to write calculations, your ability to solve quickly and optimally will increase.

Use our functions dashboard – to help kick start your journey learning all the functions used in Tableau. And once you master memorizing the functions, how the heck are you gonna write those efficiently?!

Well don’t worry, you don’t need to memorize the functions, that’s why we built the dashboard.

Truth be told, there’s not a lot of trainers teaching classes how to write code efficiently, they are instead focusing on teaching people how to solve problems because that’s the entire reason for using Tableau software!

Below is a quick tutorial – originally published on community forum, I’m reposting the basics on!

Check out the full tutorial here: fast tableau calculations.

Slowest Tableau Calculations to Fastest Tableau Calculations for given use case.


if month(date)>=5 then “orange”

elseif month(date)<=4 then “blue”

else “filter out”


// you don’t need to tell an extract to keep track of a lot of strings because it makes everything slower, it makes the extract bigger, and it isn’t going to help complex workbooks or large data sets. it will actually hurt the workbook if they want to ‘FIND these colors’ for later aggregation, which is generally always the case as they advance in their skills. also, this generates a lot of STRING manipulation in aggregation at a later date. Which generates super slow workbooks for no reason.


if month(date)>=5 then “blue”

else “orange”


// else isn’t necessary and 2 strings is slow.


if month(date)>=5 then “blue”


// else converts to NULL vs asking the app to write ORANGE.

A LITTLE FASTER: (using comments to explain what things need to be)

if month(date)>=5 then 1 //blue

elseif month(date)<=4 then 2 //orange

else 0 //filter out


// this is a step in the right direction, requires a lot less pain in the future because you’re teaching them to use INTEGERS which databases prefer over STRINGS because there’s only 0,1,2,3,4,5,6,7,8,9 choices, where strings have HUNDREDS of choices, and you’re asking the database to effectively work more than necessary and complicating the calculations.


if month(date)>=5 then 1 //blue

else 0 //orange


// just typing numbers, and commenting out strings would make this scalable for complex workbooks and bigger dataz.

Pretty dang fast.


// boolean flag.

Write fast calculations in Tableau Desktop and grow the community!

Writing fast calculations in Tableau Desktop is important for user adoption. Also, it will help grow the community to become great at native tableau desktop features. Eventually calculations need to be optimized – and this can be very complex in the future if there are hundreds of slow calculations.

Please start with —