How to Set Up a Multi-Row Formula in Tableau Prep (v 2023.1 and Earlier)

By: Eric Parker

Eric Parker lives in Seattle and has been teaching Tableau and Alteryx since 2014. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email. You can follow him on LinkedIn or sign up for a Tableau Office Hour to work with him directly!

*June, 2023 Update:

Tableau Prep published a multi-row formula capability with version 2023.2 so the below approach is most applicable for 2023.1 and earlier*

Tableau Prep is a powerful data preparation tool which allows you to do complex data transformation in a "no code" environment. No need to learn Python, SQL or R to shape your data.

While Tableau Prep has come a long ways in its first five years of existence, it's still a young tool with limitations. For example, it's not strong at crafting multi-row formulas (e.g. referencing the value from the previous row in the next row).

To create fully-fledged multi-row formulas, you might need to use Custom SQL and utilize LAG/LEAD functions, you might need to power up and use a tool like Alteryx, or maybe you can accomplish exactly what you're looking for by getting creative with Tableau Prep!

Check out this video to learn how you can use Tableau Prep to compare each month value to the prior month value and calculate the difference!

Related Resources:

Credit to Abdelaziz and Mohamed for inspiring this video!

Want to keep learning foundational skills in Tableau? Sign up for our weekly newsletter so you never miss new blog posts, videos and events!

How and Why to Build Tree Maps in Tableau

How to Build Dual Axis Charts in Tableau

0