Comparing Filtered Data to Unfiltered Data

Comparing Filtered Data to Unfiltered Data

//

Occasionally, you will find the need to compare filtered data against the total data source. As Tableau’s filters remove the data from the data partition, this can sometimes be a tricky problem.

You might be tempted to try the “Total” function in a formula like the following:

TOTAL(SUM([Sales]))

As you will quickly discover, since the filters removed the filtered results from the data source, this does not return the graph you’d expect it to and you end up with an interesting, but useless, chart.

Tableau Total Sales

By duplicating your data source and joining on it, you can bypass this problem. In the join, instead of joining logically, you will need to join on something fairly arbitrary, such as “Ship Date” in the SuperStore data. If I had joined on “Region”, I would have the same problem, as the “Region” field in the new data set would also become filtered.

Tableau Join

After you have the join setup correctly, simply pull in the “Sales” field from the joined data source and edit aliases as needed. 

Tableau Total World Wide Sales

In my case, I changed the new field to “WW Sales”, but if you’d like to compare against only “United States” sales, you can do so by simply creating a secondary filter on the new data.

Tableau Total US Sales

Note: In this example, my results are fairly simple and can also be achieved using other methods. If possible, use the built in “analysis -> totals” functionality, parameters, or calculated fields instead of a self join. In many cases, however, these alternatives are not possible and this solution is needed.


Need Expert Help?

See Our Full Menu of Data Services

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!