Related values from 2 tables

kizofilax

New Member
Joined
Sep 10, 2012
Messages
8
Hello, I have 2 tables


IS
[TABLE="width: 500"]
<tbody>[TR]
[TD]Week[/TD]
[TD]Units[/TD]
[/TR]
[TR]
[TD]9/20[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]9/27[/TD]
[TD]2000[/TD]
[/TR]
</tbody>[/TABLE]

Cases[TABLE="width: 500"]
<tbody>[TR]
[TD]Week[/TD]
[TD]Cases[/TD]
[/TR]
[TR]
[TD]9/20[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]9/20[/TD]
[TD]400[/TD]
[/TR]
[TR]
[TD]9/27[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]9/27[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]


What I need to get is

[TABLE="width: 500"]
<tbody>[TR]
[TD]Week[/TD]
[TD]Ratio[/TD]
[/TR]
[TR]
[TD]9/20[/TD]
[TD]=600/1000[/TD]
[/TR]
[TR]
[TD]9/27[/TD]
[TD]=112/2000[/TD]
[/TR]
</tbody>[/TABLE]

The tables are already linked by a relationship using Week and I am trying to get that Ratio measure, any help with this?

Thanks
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
To create a ratio, put the Week column from the IS table in the pivot table row lables, and then create a new measure with the following definition:

CALCULATE( SUM( 'Cases'[Cases] ) ) / SUM( 'IS'[Units] )
 
Upvote 0
To create a ratio, put the Week column from the IS table in the pivot table row lables, and then create a new measure with the following definition:

CALCULATE( SUM( 'Cases'[Cases] ) ) / SUM( 'IS'[Units] )


Thanks Javier, the issue with this is that it works if for the "x" axis I use the dates from the table IS but if I use the axis from the Cases column it doesn't, it gives me the correct sum for Cases for for Sum IS it gives me the total sum (not the sum per date)

And I need to use the Cases because I have several fields in that table that I need to use as slicers

Thanks
 
Upvote 0
In that case, use the following expression instead:

CALCULATE( SUM( 'Cases'[Cases] ) ) / CALCULATE( SUM( 'IS'[Units] ), 'Cases')
 
Upvote 0

Forum statistics

Threads
1,223,931
Messages
6,175,465
Members
452,646
Latest member
tudou

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top