4 Replies Latest reply on Nov 8, 2017 3:18 PM by Tim Fine

# Comparing values from two sheets in a dashboard

Hi Tableau Experts-

Suppose I have a dashboard that contains two sheets.

The top sheet (Sheet 1) contains a single value that is displayed from a datasource that a user can filter as needed.  The bottom sheet (Sheet 2) is a benchmark using the same data, but is filtered independently.

What I'm looking to do is pull the value from sheet 1 into sheet 2 so that I can display it in the tooltip and subtract it from the value in sheet 2.  For example, suppose the filtered value in sheet 1 is 60, but the user wants to compare it against category 2 in sheet 2.  The Sheet 1 value in Sheet 2 needs to display 60 and a difference of 50.  If the category filters in Sheet 1 or Sheet 2 are changed, the dashboard should be updated accordingly.  Screen shot below, sample attached.

Any help would be much appreciated.

• ###### 1. Re: Comparing values from two sheets in a dashboard

Hi Andrew,

I'm not sure this is the easiest way to accomplish your desired result but this view can be accomplished using Data Blending.

Part I. Create a Common Blend field

1. Create a calculated field called "Blend" with the calculation: 'A'

2. This simply creates a common value that you can blend on later, it will be unaffected by filtering

Part II. Duplicate the data source and blend

1. Right-click on the data source and select Duplicate

2. Click on the secondary data source and click the link button next to Blend

Part III. Create the calculation for the difference between the two values

1. Create a calculated field called "Difference" with the formula: [Calc]-[Sheet1 (DSource)].[Calc]

2. Add it to the view.

Part IV. Party because it's Friday.

Hope this helps!

• ###### 2. Re: Comparing values from two sheets in a dashboard

Could you post the revised Tableau worksheets and dashboard? Thanks.

• ###### 3. Re: Comparing values from two sheets in a dashboard

Hi Nicholas. I can't follow your explanation. Could you please add more step detail. For example what is 'A'? Could you please note which data source such as sheet 1 or sheet 2.  What is [Calc]? Thanks.

• ###### 4. Re: Comparing values from two sheets in a dashboard

I read this differently from the original responder.

It looks to me as if the question is how to compare numbers on two worksheets when they're drawn from the same data source, and I think the answer was how to compare numbers from two data sources, regardless of whether they're on the same worksheet or not.

If I'm reading it right, I'd approach it from a different perspective and "filter" without filtering.

Set a "flag" calculated field (1/0) based on parameters, then allow the user access to the parameters. element one is based on the flag being 1 and this will vary according to the parameters settings.

However, the data are not actually filtered s so element two can be controlled by a completely separate set of criteria.

This enables both charts to be on the same worksheet, so the original question becomes moot.