SOLVED

PivotTable Error with Relationships using Data Model

Copper Contributor

Hi guys,

I have these 2 related tables by the CodEjeEstrategico field:relationship-tables.PNG

 

What I need to get is this PivotTable result:

desiredPivotTable.png

However, all of the data of the Table1 is repeated in every row of the Table 2, as you can see in the following image:

wrongPivotTable.png

And I don't know how to solve it, I really hope you can help me. This is the same problem I have with another Excel which has more related tables and much more data.

 

I'm attaching the file.

Thank you very much in advance.

 

Greetings

Humberto

 

7 Replies
I expect you have the relationship in the wrong direction. Where it currently shows a 1 (left-hand side of the arrow) it should show the * and vice versa.

Hi Jan,

Thanks for answering. In this case, the relationship is ok, given that one record or the table1 could be related with one or more than one record of the table 2, and by the way, it is the Excel that makes that kind of relation.

Without (a sample of) your data this is very hard to answer.
best response confirmed by Humberto_Herrera (Copper Contributor)
Solution

Most probably for you data like in this model

image.png

rows selected as

image.png

What to do is to add one more column into main table with related fielld

image.png

and make Pivot Table on it

image.png

or simply land the table back into the sheet with DAX expression like

image.png

(Data->Existing Connections->Open Table 1, right click on it, Table->Edit DAX->select DAX).

See in attached

Thank you very much for your answer Sergei,

 

I did it by adding a calculated column (in the table of the data model), applying the RELATED function, and making the corresponding pivot table on it.

 

At the beginning, I thought it was enough with having both related tables (with correct data) and then creating the pivot table in order to arrange the fields. However, it didn't work. The question I still have is why does this happen? Is it an Excel bug? I hope in the next Excel version it isn't necessary to add related fields :)

 

Thanks again.

Hi Jan,

Thanks for your time.

 

I attached the data in the initial post.

@Sergei Baklan 

 

Hi all,

I have a similar issue as the one that has opened this post.

 

However, in my case, it is not possible to create a RELATED column,because entities are linked by date, and a more complex network of relationships.

 

I am having the same issue of getting a Pivot Table with repeated labels, that do not belong to the specific headings.

 

This is the relationships diagram:

Relationships.png

 

 

Bellow, the relationship list:

 

Relationships List.png

 

This are the fields I am using to generate the Pivot Table from the Data Model:

 

Pivot fields.png

 

And this is the pivot table I get as a result, where lots of entries appear as blank in a category where they don't even exist (all labels in that column appear repeted inside every single level from the previous category):

Pivot Table.PNG

1 best response

Accepted Solutions
best response confirmed by Humberto_Herrera (Copper Contributor)
Solution

Most probably for you data like in this model

image.png

rows selected as

image.png

What to do is to add one more column into main table with related fielld

image.png

and make Pivot Table on it

image.png

or simply land the table back into the sheet with DAX expression like

image.png

(Data->Existing Connections->Open Table 1, right click on it, Table->Edit DAX->select DAX).

See in attached

View solution in original post