Year Formats Changing in GETPIVOTDATA

Claymationator

Well-known Member
Joined
Sep 26, 2006
Messages
705
I am consolidating a few different data sources in PowerPivot and have a table that contains our fiscal calendar. I am using that calendar as a lookup for the other tables so that I can display the values appropriately as it relates to our business. The fiscal calendar looks like this one here:


Excel 2012
ABCDEF
1DateFiscalYearFiscalMonthFiscalQuarterFiscalWeekDateLookup
21/2/20062006111P1 - WK1
31/3/20062006111P1 - WK1
41/4/20062006111P1 - WK1
51/5/20062006111P1 - WK1
61/6/20062006111P1 - WK1
71/7/20062006111P1 - WK1
81/8/20062006111P1 - WK1
91/9/20062006112P1 - WK2
101/10/20062006112P1 - WK2
111/11/20062006112P1 - WK2
121/12/20062006112P1 - WK2
131/13/20062006112P1 - WK2
141/14/20062006112P1 - WK2
CalendarLookup


The date in that table is then matched up with the business date in another table and I am able to look at results by week, period, quarter or year (based on our fiscal calendar).

All of the data seems to be coming in just fine, and I have it all lined up. However, I am building some dynamic reporting on the front end using variations of GETPIVOTDATA. When I select a value to start the formula the format of the year is being changed from what I see in my lookup table and what comes across in the GETPIVOTDATA formula.

Code:
=GETPIVOTDATA("[Measures].[Sum of Amount]",$A$3,"[Enterprise_Sites].[Name]","[Enterprise_Sites].[Name].&[001 - St. George]","[Enterprise_PromoID].[Name]","[Enterprise_PromoID].[Name].&[Freq Diner Lrg Drink]","[CalendarLookup].[Year]","[CalendarLookup].[Year].&[2.014E3]","[CalendarLookup].[DateLookup]","[CalendarLookup].[DateLookup].&[P1 - WK2]")

Basically the only part that is causing me problems is the Year portion where it is "[Year].&[2.014E3]" where I would expect (based on the table) that it would be "[Year].&[2014]".

Anyone have any idea why the year format would be different than what is in my lookup table?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
That may be correct, but it still doesn't seem to match the actual formatting for scientific notation that is available in Excel. I am not able to reproduce the actual "2.014E3" without getting an error. I can get something like "2.014E+03", but not exactly what comes across by default in the GETPIVOTDATA formula. Basically I am forced to use the "+" in the format.

In the actual sheet I am modifying the GETPIVOTDATA formula to be variable based on other inputs and data validation on a dashboard, so it has to match exactly what is in the pivot table, but the year isn't even formatted like that in the pivot table itself (see below in cell D4).


Excel 2012
ABCDEFG
42014
5NameNameValuesP1 - WK1P1 - WK2P1 - WK3P1 - WK4
6001 - St. George25% Military Disc.Sum of Amount
7Sum of lCount
8FB Free DrinkSum of Amount
9Sum of lCount
10Freq Diner JuiceSum of Amount
StorePromoPIVOT


I need to figure out why the format is coming across like that when it isn't formatted that way in the raw data, or in PowerPivot...but it is in the PivotTable that is based on the PowerPivot data.
 
Upvote 0
Hi Claymationator -
Were you able to find a solution to this problem? I'm having the exact same issue.

Thanks!
 
Upvote 0
Maybe I'm reading this wrong... but if the data is stored in Power Pivot then shouldn't you be using cube formulas instead of GETPIVOTDATA?

They'll be much more reliable. You can even include slicers attached to your pivot table to capture that filter context.
 
Upvote 0

Forum statistics

Threads
1,224,138
Messages
6,176,593
Members
452,738
Latest member
kylua

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