Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Folder name to Column

I am trying to create a report where the excel sheets are all stored inside separate folders inside the root directory folder. If I use the root directory folder for "Get Data", is there a way to mak...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Anonymous,

     

    You can add a custom column with below formula to get file's parent folder name as custom column value.

    #"Added Custom" = Table.AddColumn(#"Previous Steps", "Parent", each List.First(List.LastN(Text.Split([Folder Path],"\"),2)))

     

    Regards,

    Xiaoxin Sheng