Relative references and GETPIVOTDATA from POWERQUERY

nekthen

New Member
Joined
Mar 8, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
=GETPIVOTDATA("[Measures].[Sum of Net amount]",'Sheet1'!$A$3,"[SAGE_Sales detail_0].[Date (Year)]","[SAGE_Sales detail_0].[Date (Year)].&[2023]","[SAGE_Sales detail_0].[Account Reference]","[SAGE_Sales detail_0].[Account Reference].&[ACCREF1]")

So this is my Generated formula. I need to change ACCREF1 to be a relative reference to the list of accounts in column A, but

=GETPIVOTDATA("[Measures].[Sum of Net amount]",'Sheet1'!$A$3,"[SAGE_Sales detail_0].[Date (Year)]","[SAGE_Sales detail_0].[Date (Year)].&[2023]","[SAGE_Sales detail_0].[Account Reference]",A2) returns #REF!

Surely I am missing something simple but what is it?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
This formula works fine =IFERROR(GETPIVOTDATA("Value",Pivot!$A$3,"Account",$C37, "Month",TEXT(T$6,"mmm")),0), but this pivot table does not use a table in the data model. So the question is how to alter the formula.
I tried using this format with Generate GETPIVOTDATA turned off on the pivot table linked to the data model but all I get is the dreaded #REF!
 
Upvote 0
Assuming A2 contains the text ACCREF1, then you want this:

Excel Formula:
=GETPIVOTDATA("[Measures].[Sum of Net amount]",'Sheet1'!$A$3,"[SAGE_Sales detail_0].[Date (Year)]","[SAGE_Sales detail_0].[Date (Year)].&[2023]","[SAGE_Sales detail_0].[Account Reference]","[SAGE_Sales detail_0].[Account Reference].&["&A2&"]")
 
Upvote 0
Solution
Glad we could help, and welcome to the forum, by the way! :)
 
Upvote 0

Forum statistics

Threads
1,215,095
Messages
6,123,072
Members
449,093
Latest member
ripvw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top