+ Reply to Thread
Results 1 to 5 of 5

Power Query Variables and how to use them

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    594

    Power Query Variables and how to use them

    Hi,
    I recently had to use a variable in power query , I could not get it to accept the column name ,but haven't been able to find much information on how to use them. I had to declare the start date (sdate) as a variable to use with List.Select, but then had to also make the rest a variable also up to that point it had just been ? whatever not being a VAR is ?
    Work book attached ; queries 'typed in ' and "VAR steps" .


    Please Login or Register  to view this content.
    [/CODE]


    I tried using ;

    Please Login or Register  to view this content.

    but this didn't work, can someone help with information on why I had to use the variable in the first place and any general help

    Richard
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: Power Query Variables and how to use them

    Not exactly sure what you are trying to do. Maybe this video by Mynda Treacy will help. If not, then instead of showing what you have tried, how about an explanation (detailed) of what you want to happen.

    https://www.youtube.com/watch?v=_c3CIcH58K4
    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

  3. #3
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    594

    Re: Power Query Variables and how to use them

    I have, I attached a workbook with the resulting list of dates between start and end ready for expansion, I didn't expand them as I jus thought it would serve not purpose regarding the question.
    My question was why did I have to declare the start date as a variable when using list.select?
    why could i not just use the column name? and having done that I was then forced to declare the rest of the code as a variable also? but thanks for the link it's not one I've seen.

    Richard

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Power Query Variables and how to use them

    Try

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

  5. #5
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    594

    Re: Power Query Variables and how to use them

    you're quite good at this aren't you, that's really good,
    I have used differently named variables when using List.SelectRows to compare things from 'inside' and 'outside' tables and also for list.generate and accumulate, not that I really understand them either but never thought to try it here.

    Richard.

+ 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/Power Pivot Conditional Column creation & chart
    By mz_h in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-12-2020, 06:07 PM
  2. [SOLVED] 2 fields checker- Request for alternative option in Power Query or Power Pivot
    By Shareez Saleem in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2020, 08:36 AM
  3. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  4. [SOLVED] Power Query - excel formula translation into Power Query
    By afgi in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-19-2020, 03:38 AM
  5. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  6. Excel Power Query Refresh or Access Query - 2nd Query Run is faster
    By Steveapa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2020, 10:16 AM
  7. 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

Tags for this Thread

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