SOLVED

Power Pivot Related table not providing the correct results

%3CLINGO-SUB%20id%3D%22lingo-sub-2234535%22%20slang%3D%22en-US%22%3EPower%20Pivot%20Related%20table%20not%20providing%20the%20correct%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2234535%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20in%20need%20of%20some%20serious%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20get%20the%20related%20values%20from%20the%20%22Test%202%22%20table%20regarding%20Total%20Number%20of%20Contacts%20for%20the%20specific%20dates.%20Instead%20of%20showing%20the%20correct%20values%2C%20you%20can%20see%20that%20it%20takes%20the%20total%20number%20of%20contacts%20for%20both%20dates%2C%20instead%20of%20100%20%26amp%3B%20200.%20Does%20anyone%20have%20any%20idea%20what%20it%20provides%20the%20wrong%20answers%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2234535%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

Hi guys,

 

I am in need of some serious help.

 

I am trying to get the related values from the "Test 2" table regarding Total Number of Contacts for the specific dates. Instead of showing the correct values, you can see that it takes the total number of contacts for both dates, instead of 100 & 200. Does anyone have any idea what it provides the wrong answers?

5 Replies

@Robin_Lindstrom 

The context filter in your existing pivot table is on Date from the date table Test3 and this table has no relationship with the table Test2 that's why it is not showing what you expect it to show.

 

First create a relationship on Date field of Test2 and Test3 tables like below and this would be an inactive relationship showed as dotted lines.

Relationship.jpg

 

Then create the following Measure...

 

Total Contacts:=CALCULATE (
    SUM ( Test2[Total Number of Contacts] ),
    USERELATIONSHIP ( Test3[date], Test2[TheDate] )
)

 

 

And then drag this measure in the Values area of the Pivot Table and it will show you the figures you are trying to see.

 

Please refer to the attached for more details.

 

 

 

@Subodh_Tiwari_sktneer 

 

Thank you, that works!

Before I received your answer, I tried this solution as well, it provides the same results, please look in the file attached.

 

Which way is better ?

Kind Regards,

 

Robin

 

 

best response confirmed by Robin_Lindstrom (Occasional Contributor)
Solution
Spoiler
 

@Robin_Lindstrom 

 

Obviously USERELATIONSHIP is straightforward and better than CROSSFILTER where you know what you are doing. CROSSFILTER has some drawbacks unless you know how the filter context is being evaluated in your Pivot Table.

Though in your case both the methods produce the same output, I would prefer USERELATIONSHIP over CROSSFILTER.

 

Thanks a lot! Really appeciate it!