Forum Discussion
Power Query - ODBC limiting downloaded data based on the date column
Hello, I am looking for a solution to limit the amount of data downloaded from a power query to Excel.
Using ODBC, the query is connected to the postgresql database and the table containing the sales order headers. This table contains thousands of orders from over a dozen years.
The file will be made available to a person who does not know power query and will not be able to edit the query and limit the data themselves.
Is it possible to limit the data downloaded from the database using a macro?
In the query I have an InputDate column that will be used to limit the data. The macro will refresh the entire table in Excel based on the dates from cells B3 and B4, I will also add a button to which this macro will be assigned, so that the person handling the file can easily enter the date range from-to in B3 and B4, and pressing the button will refresh the query in the selected range.
Below is the sample how the imported data looks like.
Thank you in advance for your help.
1 Reply
- Syndicate_AdminAdministrator
Create a view in your database with the appropriate filter. Point Power Query to the view.