I'm trying to get a pivot table, where I can select the values from something like a slicer.
I found out that using GETPIVOTDATA can get the trick with a dropdown list, but not very usefull since it's only 1 cell.
try:
=QUERY({A2:A8, INDIRECT(
ADDRESS(2, MATCH(D10, 1:1, 0))&":"&
ADDRESS(8, MATCH(D10, 1:1, 0)))},
"select Col1,sum(Col2)
where Col1 is not null
group by Col1
label sum(Col2)''", 0)