SOLVED
Home

PivotTable : Unexpected behavior with 2 tables

%3CLINGO-SUB%20id%3D%22lingo-sub-908507%22%20slang%3D%22en-US%22%3ERe%3A%20PivotTable%20%3A%20Unexpected%20behavior%20with%202%20tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-908507%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F423958%22%20target%3D%22_blank%22%3E%40CastyChichi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExcel%20forces%20relationships%20only%20when%20it%20evaluates%20the%20measure.%20Other%20words%2C%20if%20you%20add%20into%20the%20Values%20for%20example%20Count%20of%20Products%2C%20result%20will%20be%20as%20expected%2C%20i.e.%20Revenues%20related%20to%20Products%20only.%20Before%20that%20it%20shows%20Cross%20Join%20result%20for%20two%20tables%20-%20for%20each%20row%20of%20one%20table%20all%20rows%20from%20another%20table.%3C%2FP%3E%0A%3CP%3EIn%20general%2C%20Pivot%20Table%20is%20aggregation%20tool.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-911137%22%20slang%3D%22en-US%22%3ERe%3A%20PivotTable%20%3A%20Unexpected%20behavior%20with%202%20tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-911137%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3BThank%20you%20very%20much!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-907170%22%20slang%3D%22en-US%22%3EPivotTable%20%3A%20Unexpected%20behavior%20with%202%20tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-907170%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3CBR%20%2F%3EThe%20first%20picture%20shows%20the%20expected%20behavior%20of%20adding%20'Product'%20and%20'Revenue'%20to%20a%20pivot%20table.%20Now%20when%20i%20add%20the%20same%20fields%20but%20from%202%20different%20tables%20linked%20with%20a%20relationship%2C%20the%20result%20is%20different%20(please%20see%202nd%20picture).%3CBR%20%2F%3ECould%20somebody%20explain%20this%20weird%20behavior%20%3F%20Thanks%20in%20advance%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3EPivotTable%20with%201%20table%3C%2FU%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20670px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137060i3F5AC1A07E35AFF8%2Fimage-dimensions%2F670x455%3Fv%3D1.0%22%20width%3D%22670%22%20height%3D%22455%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CU%3EPivotTable%20with%202%20tables%3C%2FU%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20822px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137061iF465611C4BD683F8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CU%3ERelationship%3C%2FU%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20663px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137063iD97C66E419D720FE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-907170%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDatamodel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPivotTable%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ERelationship%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Etable%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
CastyChichi
New Contributor

Hi,
The first picture shows the expected behavior of adding 'Product' and 'Revenue' to a pivot table. Now when i add the same fields but from 2 different tables linked with a relationship, the result is different (please see 2nd picture).
Could somebody explain this weird behavior ? Thanks in advance

 

PivotTable with 1 table

image.png

PivotTable with 2 tables

image.png

Relationship

image.png

2 Replies
Highlighted
Solution

@CastyChichi 

Excel forces relationships only when it evaluates the measure. Other words, if you add into the Values for example Count of Products, result will be as expected, i.e. Revenues related to Products only. Before that it shows Cross Join result for two tables - for each row of one table all rows from another table.

In general, Pivot Table is aggregation tool.

Highlighted

@Sergei Baklan Thank you very much!

Related Conversations
Some Behavior changes in Edge
Maan2003 in Discussions on
1 Replies
Counting Days
Tim Hunter in SQL Server on
2 Replies
Filter complex table to simple table
Sam2009 in Excel on
1 Replies