Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Tini-Bee
New Member

Excel.Workbook (Multiple Files and Multiple Worksheets)

Hello,

I have an excel file Weekly Finance ddmmmyy.xlxs in a folder (C:\Data). This excel file has a number of worksheets (A, B, C, Mapping, Dates-Actual...) that I need to import, transform and load into Power BI. I'm not looking to combine the worksheets from the onset; simply transform each sheet individually then apend as a new consolidated query and create When I've tried this as a file it works perfectly well but given that this is a file whose name will change based on the date, I can't be updating the steps in PQ for it to work. 

Any suggestions or examples of a similar solution would be appreciated.

Thanks.

2 ACCEPTED SOLUTIONS
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Tini-Bee ,

 

try to parameterize the file name and use references for multiple access.

https://docs.microsoft.com/en-us/power-query/power-query-query-parameters

https://powerpivotpro.com/2017/05/power-query-magic-part-1-always-good-references/

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

v-shex-msft
Community Support
Community Support

Hi @Tini-Bee,

I'd like to suggest you use DateTime.LocalNow function to extract current system DateTime and use these concatenate with your connection string. (it will dynamic changes when system data changes)

Connection= "C:\Data\Weekly Finance " & Date.ToText(Date.From(DateTime.LocalNow()),"ddMMMyy")&".xlxs"

1.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Tini-Bee,

I'd like to suggest you use DateTime.LocalNow function to extract current system DateTime and use these concatenate with your connection string. (it will dynamic changes when system data changes)

Connection= "C:\Data\Weekly Finance " & Date.ToText(Date.From(DateTime.LocalNow()),"ddMMMyy")&".xlxs"

1.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Tini-Bee ,

 

try to parameterize the file name and use references for multiple access.

https://docs.microsoft.com/en-us/power-query/power-query-query-parameters

https://powerpivotpro.com/2017/05/power-query-magic-part-1-always-good-references/

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.