Forum Discussion
Add sheet name to folder query
Hi pros,
I am using query excel files from Folder.
It is good that Power Query automatically adds file name column to corresponding data, something like:
| Name | Acc | Amount |
| file1.xlsx | acc1 | 1 |
| file1.xlsx | acc2 | 2 |
| file2.xlsx | acc1 | 2 |
Similarly, I would like to add sheet name column (which I chose at Navigation step) to corresponding data too, expected:
| Name | Sheet | Acc | Amount |
| file1.xlsx | sheet1 | acc1 | 1 |
| file1.xlsx | sheet1 | acc2 | 2 |
| file2.xlsx | sheet1 | acc1 | 2 |
Furthermore, I wish sheet name added will be dynamic to my chosen at Navigation step which will not lost reference when I select another sheet at Navigation step. Please help!
Thanks a lot.
10 Replies
- navafolkHelper IV
Thank you, amitchandak ,
I have tried solution in first link https://community.powerbi.com/t5/Desktop/Add-custom-column-with-sheet-name/td-p/877507
, but Added Custom step is not dynamic enough. If I change my navigation sheet, this step will lost reference.
And I do not want to run macro in my file following solution in second link https://community.powerbi.com/t5/Desktop/Loading-from-Excel-How-can-I-extract-the-sheet-name-of-excel/td-p/328103
- navafolkHelper IV
- Pragati11Super User
Hi navafolk ,
There are existing threads for this:
https://community.powerbi.com/t5/Desktop/Add-custom-column-with-sheet-name/td-p/877507
https://community.powerbi.com/t5/Desktop/Add-a-column-with-the-sheet-name/td-p/537333
Thanks,
Pragati