Passing parameters to a query that provides data for PowerPivot

RichardRayJH

New Member
Joined
Jan 18, 2013
Messages
24
I can write a simple query for retrieving data, but what happens if the user needs to specify a date range, etc.? It can make a difference between retrieving several 10's of millions of rows of data and manipulating them in PP, or just getting the few hundred thousand the user actually wants. The difference in performance is substantial.

When using regular PivotTables I set up workbooks so the user can enter query parameters in cells. Oftentimes they get nice pulldown menus, etc. They want the same thing using PowerPivot. As a workaround, I can use a parameterized query to get the data into a tab in Excel, then link that back to PowerPivot, but that's a bit of hack. Is there a way to do it directly?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
If you are using Excel 2013 this is straightforward as the model is exposed to VBA.

If you are using Excel 2010 then its pretty tricky - an Irish guy called Tom has developed a bunch of techniques to hack his way into the PowerPivot model. I've had success with the VBA refresh but I understand you can also make changes to the underlying model in the procedure which would enable you to specify the date. VBA Code to Automate a PowerPivot Refresh | Gobán Saor

Jacob
 
Upvote 0

Forum statistics

Threads
1,223,937
Messages
6,175,510
Members
452,650
Latest member
Tinfish

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