+ Reply to Thread
Results 1 to 8 of 8

Passing Parameter in Power Query

  1. #1
    Forum Contributor
    Join Date
    11-10-2019
    Location
    India
    MS-Off Ver
    2013
    Posts
    386

    Passing Parameter in Power Query

    Hi

    In the attached sample, I have power query and I want to pass parameters from Column B and get relevant outpout in Column C. No of rows of data is only example and may increase or decrease

    requesting help
    Attached Files Attached Files
    Last edited by grcshekar; 06-04-2025 at 08:22 AM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,528

    Re: Passing Parameter in Power Query

    It is difficult to see what your "lookup table" looks like without the necessary credentials to access the web data. Assuming I can guess what the web data looks like when it is loaded into PQ, I would guess that a "merge" between the web data and your Excel table should do what you are trying to do. See if this tutorial (which uses two tables in Excel and merges them together) helps with what you are trying to do: https://excelchamps.com/power-query/vlookup/
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    11-10-2019
    Location
    India
    MS-Off Ver
    2013
    Posts
    386

    Re: Passing Parameter in Power Query

    This is not what i meant !

    The power query has a value MON100
    Now in excel I have Column B and Column C
    I need parametraise the value MON100 to pass it from B5 and output appears in C5
    Similarly I have parameters in B6 and B7 so the parameter should be passed to power query and result of which should appear in C6 and C7

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Passing Parameter in Power Query

    Change your current query into a function - e.g.

    Please Login or Register  to view this content.
    and rename it as something like fGetPrice

    then load your ticker data into Power Query and add a calculated column using =fGetPrice([Ticker])
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Contributor
    Join Date
    11-10-2019
    Location
    India
    MS-Off Ver
    2013
    Posts
    386

    Re: Passing Parameter in Power Query

    Unable to figure out attached excel
    Attached Files Attached Files

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Passing Parameter in Power Query

    See attached. Everything is coming back as 0 but I don't know if that's an authentication error or something else.

    I had overlooked that your original query returned a table so you'd need to alter the last line to make it just return the value you want, using:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    11-10-2019
    Location
    India
    MS-Off Ver
    2013
    Posts
    386

    Re: Passing Parameter in Power Query

    Hi
    This is correct but if I add another row it does not work,
    Attached Files Attached Files

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2507 Win 11
    Posts
    24,922

    Re: Passing Parameter in Power Query

    I use the code provided by romperstomper and added a couple of stocks and there are no issues. See the attached.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. [SOLVED] Power Query--pass parameter to web query and separate result into three columns
    By grcshekar in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-01-2025, 01:51 PM
  2. Power query Custom function / parameter query
    By Dicken in forum Office 365
    Replies: 0
    Last Post: 03-23-2022, 10:41 AM
  3. Power Query and parameter Passing - Excel 2010
    By grcshekar in forum Excel General
    Replies: 1
    Last Post: 11-27-2020, 12:22 PM
  4. Passing Excel Parameter to ODBC mysql query
    By bearclaw in forum Access Tables & Databases
    Replies: 3
    Last Post: 01-18-2013, 05:13 PM
  5. Passing date parameter in sql query
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-09-2011, 03:47 AM
  6. passing parameter to a ms query
    By redf1re in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2006, 06:45 PM
  7. Passing parameter to a query
    By Dwaine Horton in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2005, 10:06 PM

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