3 Replies Latest reply on Jul 30, 2012 1:34 PM by Tracy Rodgers

# Graph filtered results against average of total

Is there a way for me to graph my filtered results against the average for all results in the database?

For example, I want to graph return rate for a given client against the average return rate for all clients. I just don't know that it is possible. Maybe through data blending?

I apologize if I'm not being clear. I've attached an example of what I'm trying to create. The example was done in Excel, and the numbers to populate it were hand keyed. I'm trying to use Tableau to automate the process.

• ###### 1. Re: Graph filtered results against average of total

This can be done by creating a calculated field that pulls out the specific member of the dimension you would like to look at, i.e.:

if attr([Client])='John' then avg([Return Rate]) end

Then, place this and the avg([Return Rate]) on the Measure Values card and place it on the view.

Hope this helps!

-Tracy

• ###### 2. Re: Graph filtered results against average of total

I apologize, I'm not following you. I tried what you suggest, and it isn't filtering down to the desired client unless I put that client in the filter. When I do, the calculated field simply matches the other return rate calculation. If the client filter isn't on, I get nothing. What am I missing?

• ###### 3. Re: Graph filtered results against average of total

My apologies. I've done it a different way here. I've attached a sample workbook. Create two calculated fields, one for only the West Region (in this example) and one for the Total Discount.

The West Region calculation will look similar to the following:

If attr(Region)='West' then avg(Discount) end

The Total Discount:

total(avg(Discount))

Then, place Region on the level of detail shelf, Order Date on the columns shelf and create a dual axis with the two above calculations. Right click on the Total Discount calculation on the rows shelf, right click and select Compute Using-->Region.

Hope this makes more sense!

-Tracy