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

MasterBash

Board Regular
Joined
Jan 22, 2022
Messages
63
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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,223,847
Messages
6,174,992
Members
452,598
Latest member
jeffreyp

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