SOLVED

Data model relations not working properly in power pivot

Iron Contributor

Hi when doing relations i had some strange results, although same when i did in power bi it worked

 

i have 2 tables of customers one with unique values & one with duplicates, so when i made the relation from unique customer ids to duplicate customer ids, then when i did the pivot table by using data model, 

i used the customer ids from unique table & customer preferences from customer_preference table which contains duplicate ids, but it gave wrong results dont know why

power pivot.pngrelation.png

8 Replies
best response confirmed by chahine (Iron Contributor)
Solution

@chahine 

If you have nothing in Values, PivotTable performs Full Outer join, i.e. all to all. As soon as you add any value relationships work.

image.png

@Sergei Baklan  - what if I do not have values in my tables?

@grsur 

Sorry, I didn't catch. If you don't have any values in your source tables you actually have no such tables, Values could be texts, whatever. In PivotTable you need to aggregate something to have proper result, e.g. count number of such texts. 

 

Your tip made my day! Thanks so much Sergei!

@Sergei Baklan Hi, I have got the same situation and try to put some count as you have suggested but it still does not work. Do you know how can we handle this? Thanks you.

Chichi475_0-1701747509668.png

 

Thanks everyone, all very helpful.
@Chichi475 I was facing the same issue.
The problem for me was I was trying to add values from the secondary table not the primary table that was linked to the pivot table. As soon as I added a value from the primary table to values it worked fine.
1 best response

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

@chahine 

If you have nothing in Values, PivotTable performs Full Outer join, i.e. all to all. As soon as you add any value relationships work.

image.png

View solution in original post