SOLVED

Basic power Pivot question (why does the relationship "not work")

Iron Contributor

I made a PowerPivot model and am wondering why PowerPivot cannot make an aggregation by dimension (row). This is a very basic question but it would help me a lot to understand how these models work if someone could give me a quick answer.

 

Here's the simplified version:

I have two tables, ItemVendor and tItemQties.

ItemVendor lists SKU's and their Supplier.

bartvana_0-1629009447888.png

tItemQties lists SKU's and their quantities.

bartvana_1-1629009479725.png

I added both tables to the PowerPivot model, and made a relationship between the SKU columns.

bartvana_2-1629009614083.png

What I fail to understand is why, in a PowerPivot pivot table, the relationship "doesn't work":

bartvana_3-1629010001756.png

All suppliers get the full total, instead of their own total. 

 

My expected result would have been of course this (which I made in "standard" Excel, not PowerPivot):

bartvana_4-1629010049597.png

Many thanks in advance for any clarification you can give!

5 Replies
best response confirmed by bartvana (Iron Contributor)
Solution

@bartvana Your model is a bad example since both tables contain unique SKU's. In reality the (fact) table with the Quantites holds non-unique SKUs whereas the (dimension) table with the SKU and Supplier info will hold the unique SKU's.

 

If you drag the relationship from the fact table (the many side) to the dimension table (the one-side) it shall work.

Screenshot 2021-08-15 at 09.46.11.png

That simple :). Fabulous, thank you!

@bartvana 

As variant, you may remove relationship at all and using such measure 

Total QTY:=CALCULATE (
    SUM ( tItemQties[Qty] ),
    TREATAS (
        VALUES ( ItemVendor[SKU] ),
        tItemQties[SKU]
    )
)
Interesting, thank you!

@bartvana 

Above is only to illustrate other possibilities.  From performance point of view physical relationship is always preferable, if use virtual one when better TREATAS.

1 best response

Accepted Solutions
best response confirmed by bartvana (Iron Contributor)
Solution

@bartvana Your model is a bad example since both tables contain unique SKU's. In reality the (fact) table with the Quantites holds non-unique SKUs whereas the (dimension) table with the SKU and Supplier info will hold the unique SKU's.

 

If you drag the relationship from the fact table (the many side) to the dimension table (the one-side) it shall work.

Screenshot 2021-08-15 at 09.46.11.png

View solution in original post