How can I use GETPIVOTDATA to work with a date range?
=GETPIVOTDATA("QTY",$A$1, "Date","1/1/2000 ~ 1/1/2019") or
1/1/2000 ~ Today() or group all past dates from today (date < Today())
Something like this.
I get a REF error if I group the dates directly in the pivot table...
Here is an Example, hope which will help you to get an idea.
Else please elaborate your question with examples "snaps/excel file", which will help to give you answer easily.

Formula:
{=SUMPRODUCT(IFERROR(GETPIVOTDATA("Volume",$E$17,"Date",ROW(INDIRECT(H30&":"&H31))),0))}
Formula Array: Produce enclosing { } by entering formula with CTRL+SHIFT+ENTER!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With