Hi,
Looking for some help!
Data set up as follows...
Table 1 (sales data)
[TABLE="width: 338"]
<colgroup><col><col span="3"><col></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]Product[/TD]
[TD]DC[/TD]
[TD]Month[/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD]Apple1[/TD]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1500[/TD]
[/TR]
[TR]
[TD]Pear1[/TD]
[TD]Pear[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Orange1[/TD]
[TD]Orange[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Apple1[/TD]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1200[/TD]
[/TR]
[TR]
[TD]Pear1[/TD]
[TD]Pear[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD]Orange1[/TD]
[TD]Orange[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]60[/TD]
[/TR]
</tbody>[/TABLE]
Table 2 (conversion data)
[TABLE="width: 400"]
<colgroup><col><col span="2"><col><col></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]Product[/TD]
[TD]DC[/TD]
[TD]Denominator[/TD]
[TD]Numerator[/TD]
[/TR]
[TR]
[TD]Apple1[/TD]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD]Pear1[/TD]
[TD]Pear[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Orange1[/TD]
[TD]Orange[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Apple2[/TD]
[TD]Apple[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Pear2[/TD]
[TD]Pear[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Orange2[/TD]
[TD]Orange[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[/TR]
</tbody>[/TABLE]
There is a relationship between Table 1 and Table 2 via the ID column (a concatenation of 'Product' and 'DC').
I want a measure to convert the sales data in Table 1 using the relevant denominator and numerator in Table 2. In simple terms, the formula would be:
The problem I can't get my head around is how to get the formula to use the correct row from Table 2.
The resulting measure should return the values as shown in 'Sales Revised' below:
[TABLE="width: 250"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD]Product[/TD]
[TD]Month[/TD]
[TD]Sales Revised[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]80[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]30[/TD]
[/TR]
</tbody>[/TABLE]
Hope someone can help.
Cheers,
Matty
Looking for some help!
Data set up as follows...
Table 1 (sales data)
[TABLE="width: 338"]
<colgroup><col><col span="3"><col></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]Product[/TD]
[TD]DC[/TD]
[TD]Month[/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD]Apple1[/TD]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1500[/TD]
[/TR]
[TR]
[TD]Pear1[/TD]
[TD]Pear[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Orange1[/TD]
[TD]Orange[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Apple1[/TD]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1200[/TD]
[/TR]
[TR]
[TD]Pear1[/TD]
[TD]Pear[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD]Orange1[/TD]
[TD]Orange[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]60[/TD]
[/TR]
</tbody>[/TABLE]
Table 2 (conversion data)
[TABLE="width: 400"]
<colgroup><col><col span="2"><col><col></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]Product[/TD]
[TD]DC[/TD]
[TD]Denominator[/TD]
[TD]Numerator[/TD]
[/TR]
[TR]
[TD]Apple1[/TD]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD]Pear1[/TD]
[TD]Pear[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Orange1[/TD]
[TD]Orange[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Apple2[/TD]
[TD]Apple[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Pear2[/TD]
[TD]Pear[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Orange2[/TD]
[TD]Orange[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[/TR]
</tbody>[/TABLE]
There is a relationship between Table 1 and Table 2 via the ID column (a concatenation of 'Product' and 'DC').
I want a measure to convert the sales data in Table 1 using the relevant denominator and numerator in Table 2. In simple terms, the formula would be:
Code:
=SUM(Table1[Sales]) * Table2[Denominator] / Table2[Numerator]
The problem I can't get my head around is how to get the formula to use the correct row from Table 2.
The resulting measure should return the values as shown in 'Sales Revised' below:
[TABLE="width: 250"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD]Product[/TD]
[TD]Month[/TD]
[TD]Sales Revised[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]80[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]30[/TD]
[/TR]
</tbody>[/TABLE]
Hope someone can help.
Cheers,
Matty