Aug 14 2021 11:51 PM
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.
tItemQties lists SKU's and their quantities.
I added both tables to the PowerPivot model, and made a relationship between the SKU columns.
What I fail to understand is why, in a PowerPivot pivot table, the relationship "doesn't work":
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):
Many thanks in advance for any clarification you can give!
Aug 15 2021 12:46 AM - edited Aug 15 2021 12:47 AM
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.
Aug 15 2021 02:18 AM
Aug 15 2021 12:31 PM
As variant, you may remove relationship at all and using such measure
Total QTY:=CALCULATE (
SUM ( tItemQties[Qty] ),
TREATAS (
VALUES ( ItemVendor[SKU] ),
tItemQties[SKU]
)
)
Aug 16 2021 10:08 AM
Aug 16 2021 03:03 PM
Above is only to illustrate other possibilities. From performance point of view physical relationship is always preferable, if use virtual one when better TREATAS.
Aug 15 2021 12:46 AM - edited Aug 15 2021 12:47 AM
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.