Are the products all members of the same field? If so, maybe try a calculated field like the following:
If [Product] = "A" then Sum([Revenue])
Also if the view isn't filtered you might try Grand Totals for columns, but be aware GT sums the underlying data, not the data in the view, so it can be confusing to work with.
It is worth noting that thinking about data in terms of cells isn't the best way to work with Tableau. Tableau does things thinking in terms of fields, you add fields to the view and it does a lot on the back end to structure it in a way the software thinks makes sense.
If possible, sharing the workbook would make this question easier to answer.
Thanks for getting back to me.
Yes, the products are all members of the same field. I’ve tried the If statement you suggested but the calculation doesn’t verify: “cannot mix aggregate and non-aggregate comparisons or results in “IF” expressions”.
Unfortunately I cannot send the workbook because it has confidential company data.
Just so I’m clear about your last statement. If I add a Grand Total to my data, it will total ALL of the values, not just the values displayed? For example, If I have Products A, B, C, D, E & F but I filter on just A,B & C, the Grand total will be a total of A, B, C, D, E & F? If so, that seems counter intuitive. What if I wanted to show only the totals of the filtered products?
Sorry I realize my statement about grand totals was confusing. GT does use the underlying data to do its calculations and in concert with certain other operations this can return unexpected results. If simply filtering such as with the example you gave, GT should work as expected. However if you are also using table calculations in the view, or other operations, then the grand totals will be calculated before the table calculation is applied, which can return a confusing result. The following forum post provides a really detailed explanation of how grand totals work: Why Your Grand Total or Subtotal Isn't Working as Expected
If you run into issues with Grand Totals, there are a lot of resources to help, but if its not an issue with the view you're building then I apologize for being confusing.
As for the calculation error for aggregate vs. non-aggregate comparisons, try wrapping [Products] in a MIN() or ATTR() function.
Hope that helps!
I ran into similar issue recently with grand totals where it doesn't seem to sum what's visible in the view (due to reasons provided by Rachel) & had to put a workaround. You might get some ideas to solve your problem. You can check it out on the link provided.
I think the original question has gotten lost. I'm okay with the Grand Totals. What I am trying to figure out is how to total the revenue by product over all years selected (see original post with the format of the data). I've tried wrapping [Product] with both MIN() and ATTR() but I still receive the same errors: “cannot mix aggregate and non-aggregate comparisons or results in “IF” expressions”
Any help on this would be greatly appreciated.