A while ago I shared with you a way to build a barchart race with Tableau 2019.x or less. The first tutorial I made implied to work with data densification and some heavy table calculations. GOOD NEWS, it will be faaaar more easier to build with the new animation feature coming to Tableau 2020.x. Here is how.
I will use only one dataset with three main fields: year, category and value.
Here in the example, categories are countries and value their population across years.
You can find the dataset on the link below:
Viz animation and Rank function
Viz Animations allowed you to see changes in a chart when you use filters or pages. And we will use it! What we want to see are the changes in the ranking. Which categories go up? Wich categories go down?
For that, we need to prepare a Rank calculated field on the value we want to follow.
[Rank] = RANK_UNIQUE(sum([Value]))
And that’s it! It is the only calculated field you require to our new barchart race.
Now let’s build the thing!
Bring the Rank field into Rows. Go to Marks and add Category into Details. Right click and make it discrete.
Then bring Value field into Columns. And now it is time to configure our Rank field. Right click on Rank, choose Compute Using and use Category.
We are almost done! Bring Year into Pages. And try to start the animation.
If you do not see any animations, please check if Animations are enabled on you sheet or dashboard.
If you’ve gone that far, you did it! You just have to “pimp” your worksheet with the labels and colors you want to use.