0
votes

I am a graduate intern at a big company and I'm having some trouble with creating a measure in PowerPivot. I'm quite new with PowerPivot and I need some help. I am the first person to use PowerPivot in this office so I can't ask for help here.

I have a fact table that has basically all journal entries. See next table. All entries are done with a unique ID (serialnumber) for every product

ID  DATE     ACCOUNT#   AMOUNT
110 2010-1-1 900        $1000

There is a dimension table with has all accounts allocated to a specific country and expense or revenue.

ACCOUNT#    Expense Country
900         Revenue Germany

And another dimension table to split the dates. The third dimension table contains product information, but also contains a column with a certain expense (Expense X).

ID  Expense X   ProductName Productcolour
110 $50          Flower      Green

I made sure I made the correct relations between the tables of course. And slicing works in general.

To calculate the margin I need to deduct this expense x from the revenue. I already made a measure that shows total Revenue, that one was easy.

Now I need a measure to show the total for Expense X, related to productID. So I can slice in a pivot table on date and product name etc.

The problem is that I can't use RELATED function because the serial number is used multiple times in the fact table (journal entries can have the same serial number) And if I use the SUM or CALCULATE function it won't slice properly.

So how can I calculate the total for expense X so it will slice properly?

1
Based on the dummy dataset you exposed, what is the expected output?alejandro zuleta
To have the total of expense x in the product table, related to the serialnumbers. So I can make a pivot table and slice on date and serialnumber to show the margin of the products.japie07

1 Answers

0
votes

Check the function RELATEDTABLE.

If you create a dummy dataset I can play around and send you a solution.