Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
refer
https://community.powerbi.com/t5/Desktop/Add-custom-column-with-sheet-name/td-p/877507
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-exce...
Hi @navafolk ,
Can you add some detail to it please, preferably some screenshots on what your query is?
Thanks,
Pragati
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
Thank you @Pragati11 ,
For your first link solution, unfortunately, I do not have any other column to translate to my needed sheet name.
For you second link solution, I got same problem as @amitchandak suggestion as above.
hi @Pragati11 ,
Before change navigation sheet, it worked fine:
Before change navigation sheet, it lost reference, Expression.Error:
Hi @navafolk ,
In your 2nd screesnhot, replace the ADDED CUSTOM step with the same ADDED CUSTOM step in 1st screesnhot.
You are not referring to the source correctly in 2nd screesnhot. It has got a CHANGED TYPE step name which is wrong. It should be SOURCE.
Thanks,
Pragati
Thanks @Pragati11 ,
Sure I have to replace as same name as Navigation step. I mean is there any way to help Power Query automatically realize and replace this at name step?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |