Forum Discussion

chuongtt's avatar
chuongtt
Regular Visitor
5 years ago
Solved

Get data from folder (PDF.File) from time to time

Hi everyone,  I am starting new with PowerBI and I need help with this one.  In the folder and it has a lot of files (PDF file) and it names by date such as for example TONN 04 01 2021 (04(DD...
  • PC2790's avatar
    5 years ago

    Hi,

    I am not able to understand your requirement precisely.

    If you are looking to get only the January files form the fiolder containing numerous files, you can use the below code in Power Query:

    Follow the below steps:

    1) Go to "Transform Date" and open the Power Query editor

    2) Go the "Advanced editor" section of the query that you want to change.

    3) Add the below M query code in the existing code:

     

    let
    Source = Folder.Files("C:\Work\NewFolder"),
    #"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Name], "TONN")),
    #"Filtered Rows2" = Table.SelectRows(#"Filtered Rows", each Date.Month([Date created]) = 1)
    in
    #"Filtered Rows2"

    If you want to do it using the UI, please do as shown in the picture below:

    If I failed to understand your exact requirement, please reply back.