+ Reply to Thread
Results 1 to 2 of 2

Connect to CSV File in Power Query with Variable Name

  1. #1
    Registered User
    Join Date
    11-12-2021
    Location
    London
    MS-Off Ver
    Microsoft 365 MSO (Version 2202)
    Posts
    72

    Connect to CSV File in Power Query with Variable Name

    Hi All,

    Please Login or Register  to view this content.
    I Have created a connection to a CSV file using the above code.

    The issue I have is that a new source file is created daily and is named YYYYMMDDTESTFILE.

    Can someone please tell me how I amend the code so that when I run the query, the source file name updates dynamically to todays date?

    Many Thanks in advance

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

    Re: Connect to CSV File in Power Query with Variable Name

    In that case, I would build a parameter query where you can indicate the name of the file and it will input it into the Source step. Are you familiar with how to build parameters? If not, then this link should help you build one for your needs. Of course you will need to adapt the concept to your particular situation

    https://www.youtube.com/watch?v=gK2yBpiITvI
    Last edited by alansidman; 04-19-2024 at 03:21 PM.
    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] Unable to connect error for Power Query to web page
    By Gregb11 in forum Excel General
    Replies: 10
    Last Post: 03-12-2024, 07:59 AM
  2. Power Query Excel - connect to SharePoint folder
    By rjsnl in forum Excel General
    Replies: 1
    Last Post: 03-05-2024, 05:53 PM
  3. [SOLVED] Why is my Excel file so big even though I uploaded the data using Power Pivot/Power Query?
    By Olivia Ludwig in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 09-21-2023, 05:18 AM
  4. [SOLVED] Power Query - replace file name and sheet with variable
    By Gregb11 in forum Excel General
    Replies: 3
    Last Post: 04-08-2023, 01:32 PM
  5. Power query using step as variable
    By Dicken in forum Office 365
    Replies: 0
    Last Post: 12-09-2022, 10:59 AM
  6. Connect Listobject to QueryTable and To Power Query
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2021, 06:36 AM
  7. [SOLVED] Power Query connect to source only once
    By jaryszek in forum Excel General
    Replies: 4
    Last Post: 11-03-2020, 12:39 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