Relationsship by 3rd table?

Vikinger

New Member
Joined
Apr 22, 2013
Messages
5
[TABLE="class: kmsg"]
<tbody>[TR]
[TD="class: kmessage-left"]Hi all,

I'm a new member on your board. First of all I want to say sorry for my limited English
silly.png


I'm currently working on a financial report. In this report I want to analyze our costs per leg (we're a cruise company).

Amongst others I've the following four tables in my datamodel:

Table 1 (called Ship)
Including the columns Shipcode and Shipname

Table 2 (called Saildate)
Including the columns Date and Saildatecode

Table 3 (called deployment)
Including the columns Leg, Shipcode and Saildatecode

Table 4 (Called entries)
Including the columns Amount, Shipcode and Saildatecode


The easiest way to get the costs by leg should be to create relations between the tables "Entries" and "Deployment". But the problem is, that those relations would be n:n. That's why I've tried to set the relations as follows:

Entries[Shipcode] to Ship[Shipcode]
Entries[Saildatecode] to Saildate[Saildatecode]
Deployment[Shipcode] to Ship[Shipcode]
Deployment[Saildatecode] to Saildate[Saildatecode]

In my oppinion the tables entries and deployment should no have a relation, isn't it?

If I want to analyze our costs by leg, I get the total amount over all for each cruise. It looks like powerpivot cannot allocate the costs to the different legs.

An other possibility I've tried was to add a separate ID (1,2,3,4....) to the Deployment table. After that I've created a calculated column in the Entry-Table as follows:

=if(and(Entries[saildatecode]=Deployment[Saildatecode];Entries[Shipcode]=Deployment[Shipcode]);Deployment[Leg];0)

But this formula didn't work.

Do you have an idea how I can get an ID into the entries table or how I've to set the relations for that I can analyze our costs per leg?

Thanks for your help!
Vikinger

<form name="postform" action="/forum/post" enctype="multipart/form-data" method="post"><input name="parentid" type="hidden" value="515"> <input name="catid" type="hidden" value="4"> <input name="action" type="hidden" value="post"> <input name="76fbd925b71dc000d453e48ddb69e7fb" type="hidden" value="1"> <input name="authorname" type="hidden" value="Vikinger"> <input name="subject" class="inputbox" type="text" size="35" maxlength="50" value="Re: Relationsship over 3rd table">
<textarea name="message" class="inputbox" rows="6" cols="60"></textarea>
<input name="submit" title="Click here to submit your message" class="kbutton kreply-submit" type="submit" value="Submit"> <input name="cancel" title="Click here to cancel your message" class="kbutton kreply-cancel" type="reset" value="Cancel"> <small>Note: BBcode and smileys are still usable.</small> </form>
[/TD]
[/TR]
[TR]
[TD="class: kbuttonbar-left"]

[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You measure should look like this:
[Costs] := CALCULATE( SUM( Entries[Amount] )
, Deployment
)

Edit: In substance, this tells PowerPivot to calculate the expression SUM( ... ) taking every filter that applies to Deployment into account.
 
Upvote 0

Forum statistics

Threads
1,223,951
Messages
6,175,586
Members
452,653
Latest member
craigje92

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