+ Reply to Thread
Results 1 to 5 of 5

Creating Dynamic Parameters in Excel from link to Power Query

  1. #1
    Registered User
    Join Date
    08-29-2018
    Location
    Melbourne, Australia
    MS-Off Ver
    2016/365 both
    Posts
    22

    Creating Dynamic Parameters in Excel from link to Power Query

    Good Evening
    Any chance of someone in this group having experience with dynamic parameters. I am trying to use a Month End Date (Dynamic Date) to filter my Power Query (linked from SQL tables from Financial Software). I can hard code it each month but would like to simply enter the date in a table in Excel and it automatically updates my Reconciliation spreadsheets. I get as far as a A Submission Error Message due to the dynamic date field in power query not being in date format in the code relating to the Financial Software. I have watched Excellsfun Youtube channel Video 1349 but it uses Text fields as opposed to date fields. Any direction would be appreciated.

    Good night....

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,882

    Re: Creating Dynamic Parameters in Excel from link to Power Query

    To dynamically filter PQ table...

    You'd use variable (or calculation) in filter condition.

    For Month end date for current month...
    Please Login or Register  to view this content.
    Then you would use it like below.
    Sample M:
    Please Login or Register  to view this content.
    Or if you need to pass on to SQL statement. You need to use Text.From() to convert date type data to string, as you can only concatenate Text with Text.

    EDIT: You can see small article I wrote about using variable in SQL query (Native query) using PowerQuery and Named Range on a sheet (See 5. Using variable in Native Query).
    https://chandoo.org/forum/threads/us...s-notes.35658/
    Last edited by CK76; 03-13-2019 at 09:12 AM.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,882

    Re: Creating Dynamic Parameters in Excel from link to Power Query

    Oh, depending on your access level on SQL... Easiest thing to do is to create Stored Procedure, View or Table Valued function and query that in PQ.

  4. #4
    Registered User
    Join Date
    08-29-2018
    Location
    Melbourne, Australia
    MS-Off Ver
    2016/365 both
    Posts
    22

    Re: Creating Dynamic Parameters in Excel from link to Power Query

    Thank you CK76. I will try using this code format: EoMonth = Date.EndOfMonth(DateTime.Date(DateTime.LocalNow())) on Monday. I managed to get the PQ to update my reconciliations sheets using Jan = 1, Feb = 2 etc, but it isn't nice to look at and Accountants like dates..... I added the drop down list, and macro button to update, so pretty amazed with the power of Excel and now PQ.

    Much appreciated.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,882

    Re: Creating Dynamic Parameters in Excel from link to Power Query

    You are welcome
    PQ is one of the best features MS added to Excel.

    It this solved your question, please mark the thread as solved by using thread tools found at top of your initial post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Power query web link ?
    By common763 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-23-2018, 05:55 PM
  2. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  3. Replies: 0
    Last Post: 04-05-2018, 01:16 AM
  4. Dynamic link to Access query for updating Excel table
    By BanginMyHeadOnMyDesk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-22-2017, 11:45 AM
  5. Dynamic Parameter Using Power Query
    By NeedForExcel in forum Excel General
    Replies: 1
    Last Post: 06-16-2016, 02:51 AM
  6. Help needed for creating Dynamic Oracle Query using Excel VBA and Forms
    By vijaysram in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-14-2013, 12:32 PM
  7. Dynamic Web Query with multiple input parameters
    By Lukasz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2010, 12:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1