Share via

PowerQuery Question: Query Folder - only keep most recent file

Anonymous
2016-06-30T14:30:14+00:00

I've got a folder where files accumulate that contain data about inventory position.  I am using other queries to extract trended data from the combination of all those files.  Now need a query that just grabs the most recent file so I can show current inventory information.

Each file contains the save date, for example:  Inventory Position - 2016 06-30.csv

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2016-07-07T04:56:46+00:00

Hi Porter,

Please follow these steps to get data from the most recent file in a folder:

  1. In the data ribbon select New Query->From File->From Folder
  2. Browse to the required folder and click OK.
  3. Once the query preview pops up click Edit
  4. Power Query displays a list of files in the folder. To get data from the latest one sort the list by Date Created or Date modified
  5. Click Keep Rows-> Keep Top Rows-> In ‘Number of Rows’ type 1 to keep the latest file only and click OK
  6. On the content column click Binary
  7. Continue analyzing your data

Hope that helps.

Koby

-

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2016-06-30T17:50:35+00:00

    Hi Porter,

    Since the issues is related to Power Query, you may post your query in Excel IT Pro for better results.

    You may refer to the below link to redirect to Excel IT Pro Forum.

    http://social.technet.microsoft.com/Forums/office/en-US/home?forum=excel

    If you have further questions related to this, please let us know.

    Thank you.

    Was this answer helpful?

    0 comments No comments