VIP
Trusted Members
December 7, 2016
Hello,
As I try to show in attached file, I have noticed that when using the GETPIVOTDATA function to get data from a Pivot Table where the source data has been added to the data model I get the #Ref error. I have searched but can't find any explanation for this "error". Anyone here who can tell more about this issue?
Br,
Anders
VIP
April 21, 2015
Hi Anders, I'm not sure if I understand what you mean in the sheet by 'adding data'. I suppose extra rows with data in the columns A-C.
When I do that and refresh the pivottables I see the left one does well and the right one doesn't, as you describe.
However when I make a new GETPIVOTDATA formula for that table, it works fine and it keeps on working with new data afterwards.
So maybe something by incident not good in that specific table?
I copied the one in columns E:L downwards and that works also fine with a copy from the formula in E12.
The formula is a bit a bare version of the complete GETPIVOTDATA, so maybe there is another reason, but I'm not sure about that.
Frans
VIP
April 21, 2015
VIP
Trusted Members
December 7, 2016
Thanks Frans,
Seems the "rules" of how to use GETPIVOTDATA differs between a regular Pivot Table and a Power Pivot Table. I need to read more about this, but you gave me the answer in your example file.
The difference is that I wrote my formula as =GETPIVOTDATA("Sales",N3), which works fine with a regular Pivot Table, but apparently not with a Pivot Table where the data has been added to the data model, such Pivot Table is apparently regarded as a Power Pivot Table.
The formula you wrote is =GETPIVOTDATA("[Measures].[Sum of Sales]";$N$3) and that works. I changed my original formula to =GETPIVOTDATA("[Measures].[Sales]";N3), but I still got an error. When adding the text "Sum of" in the [Sales] section, then it works fine.
Seems I need to go back to the Power Pivot course to see what I apparently missed out.
Br,
Anders
VIP
April 21, 2015
Thanks Anders. Actually I didn't write the formula. Just clicked on the total of the right pivottable. Excel gives you the proper formula back. You can customize that one depending on which data you want to show, but I thought you needed the grand total so I did it this way.
I liked the course here from John Michaloudis, although it used the old versions of Excel (don't know how that is at this moment).
And you can certainly pick up some good things from him on this formula!
Frans
1 Guest(s)