Multiply all rows in a Tableau table chart

7.9k Views Asked by At

This seems pretty simple, but I can't seem to find a way to do this.

I need to multiply all rows in a chart - or all columns, whichever is easiest. AKA. I am looking for something like the product() function in Excel.

Any ideas on how to accomplish this?

EDIT: Row values may change, so this needs to be a dynamic calculation. Like a function to aggregate all values into a product of the values.

2

There are 2 best solutions below

0
On BEST ANSWER

A calculated field can be created with: sum([Sales])*PREVIOUS_VALUE(1) This gives the running product. Then, that field can be inserted into the table.

1
On

You can certainly create a calculated field that will multiply various columns together. Something along the lines of [Column1] * [Column2] * [Column3] will generate a new calculated measure that is the product of all three columns.

That being said, if you're doing that much data manipulation within Tableau, you should probably be giving some hard thought as to why that's necessary. While calculations are certainly possible and new Tableau 9 features such as level of detail functions make doing calcs on measures not present in your viz easier, Tableau is primarily a data presentation layer. Data manipulation apart from simple calcs and pivot/unpivot operations should be done upstream. Doing advanced manipulations within Tableau, while sometimes/often possible, can be very hard to debug and reproduce.