Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

add column and cell reference in Power Query

Hello,    I am new to using Powery Query and was wondering if someone could help me out. I have a local folder on my desktop at work that has roughly 1000 excel workbooks. Each workbook is titled {...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous 

     

    If I understand it correctly, you need to extract certain info from filename and add it to the table. If your filenames are all in the same structure, read from folder and add the 3 columns prior to read the binary to table then do Table.Combine. Do not use sample queries, and agree with edhans it is a project to re shape all your data

     

    let
        Source = Folder.Files("C:\Users\yourFolderPath"),
        #"AddJob#" = Table.AddColumn(Source, "JOB #", each Text.BeforeDelimiter([Name]," ")),
        #"AddCustPart#" = Table.AddColumn(#"AddJob#", "CUSTOMER PART #", each Text.BetweenDelimiters([Name]," "," ",1)),
        AddBillto = Table.AddColumn(#"AddCustPart#", "CUSTOMER BILL TO", each Text.BetweenDelimiters([Name]," ",".xlsx",2))
    in
        AddBillto