Forum Discussion
Folder name to Column
- Anonymous7 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
Hi Anonymous,
If you can please share some sample to test, it is hard to coding formula from simple description.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
| GL CODE | DATE | CONSIGNMENT/REFERENCE | ORDER NUMBER | CHARGE | FUEL | SUBTOTAL | GST | TOTAL |
| 3810 0000 1190 1000 | 18/06/2018 | P4419448.1 | O4419448 | $ 126.78 | $ 126.78 | $ 12.68 | $ 139.46 |
| GL CODE | DATE | CONSIGNMENT/REFERENCE | ORDER NUMBER | CHARGE | FUEL | SUBTOTAL | GST | TOTAL |
| 4450 0735 6800 0000 | $ 78.60 | $ - | $ 78.60 | $ 7.86 | $ 86.46 |
Here is an example. These two tables are in separate excel files in excel (Let's call them A and B). A and B themselves are also in separate folders, where A is in Folder C and B is in Folder D. Folder C and D are both inside root folder E. I want to know if I run Power BI with folder E as the root folder, if it's posisble to create a column where if the file is from Folder C it will get "C" as a value in the column, or if it s from Folder it will get a "D" value in that column for multiple folders (20+)
Thank for your time.
- Anonymous7 years agoNot applicable
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