New to Excel Power Query - Need to pull partial file name with most recent date

MasterBash

Board Regular
Joined
Jan 22, 2022
Messages
70
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am totally new to Power Query. I only used one to help me with a Pivot Table but that was pretty basic. If anyone has some guides I can read to help me out, I would very much appreciated it.

Now for my question.

I have my D:\ drive that I want to pull a specific file from.

In A1, I trying to use the drive path, which is D:\
in A2, I am using the partial file name, which has a specific number.

If the number is DEE-8881089, I want to load this file containing DEE-8881089 (It is a file named something like DEE-8881089-DDMMYYHHMMSS.txt) that is the most recent, because we can have multiple files with the same name, but created at different date/time.

The file is a txt file, but it contains delimiters (^).

How can someone who is completely new with Power Query do something like that ? Or any tutorials ? The guides that I read assume that you know some Power Query basics.

Thank you.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
My general advice is to turn in the formula bar (it’s in the last menu in the right once you get to Power Query. Look at the code and learn to edit it from there.

In this case, I would do a “load file, from folder”. When you get to select the file, instead of selecting it, right click the yellow folder icon at the top of the wizard and select the option to transform. This will get you into a list of all files in the correct folder.

From there, you can apply filters from the UI, or do other manipulation to get the file you want to the top of the screen. Then you can click the file to load it. You will likely need to edit some of the auto generated code to make it generic. Here is an example of when I did something similar.

 
Upvote 0
Solution
Hello,

I am totally new to Power Query. I only used one to help me with a Pivot Table but that was pretty basic. If anyone has some guides I can read to help me out, I would very much appreciated it.

Now for my question...
There's a great book on Power Query on offer from this forum, "Mastering Your Data With Power Query" by Puls & Escobar. The part on temporal data was an eye opener for me. If you prefer the written word. If you like to take a video course and follow along, Udemy has a great course on Power Query called "Stepping beyond the Power Query user interface" by Kresimir Ledinski. I learned a lot about PQ from that guy.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,080
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top