2 Replies Latest reply on May 20, 2016 10:34 AM by Dan Armstrong

# How to create a relationship between two measures?

Hi, I think this is a pretty basic question but nevertheless I am flummoxed.

I have two spreadsheets as two data sources. One has a list of 13 periods and a percentage for each period.

The other has a list of annual sales goals categorized by region and product.

I want to combine these two data sources so that I can display sales goals by period, region and product. So for instance East region for Apples and Grapes for Period 1 would be (90+95) * 7.49% or \$13.86.

When I try to combine the fields -- say, goals on columns and periods on rows -- I get this dialog:

And when I go to "Edit Relationships" the choice I get is not very useful. What I want to do is multiply the measure for the period (the percentage) times the measure for the product, region or whatever combination I choose (the sales goal). It seems that this only allows me to map a single dimension to a single dimension.

I've added a little packaged workbook with the data. There's something very basic which I am not understanding here.

I suppose I could fix this by combining the two spreadsheets, but I have simplified my example, and I don't have any control over how the data comes in.

Dan

• ###### 1. Re: How to create a relationship between two measures?

I think you want to do a cross join on those two tables.  You would first need to add a new column to each table (call it join column) and then populate it in every row with a constant value - say 'X'.  Then join both tables on that column.

1 of 1 people found this helpful
• ###### 2. Re: How to create a relationship between two measures?

Thank you, John. You are absolutely right. And here is a wonderful tutorial on cross-joins: CROSS JOIN with Tableau's join dialog   On the way I tried some other things and learned about custom SQL. You pointed me in the right direction and Google did the rest.

Dan