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.
I'd like to automate some reports.
I have numerous excel files into a folder. Each excel files have multiple sheets.
Ideally :
- All excel sheets should have the first row and the last row deleted.
- Then first row set as header
Could someone please give me some guidance how to create a function which would perform the above on all excel sheets?
Thank you,
Lorenna
Solved! Go to Solution.
Hi @Anonymous,
Based on test, you could refer to below steps in query editor:
Sample excel files in my folder:
1.Get data from one of the excel files(here is A) and delete the first and last row.
2.Modify the code in advanced editor.
Before modify:
Insert this code and modify the source:
(para as text) as table => let Source = Excel.Workbook(File.Contents("C:\Users\danielh\Desktop\Parameter\"¶&".xlsx"), null, true),
After modify:
Here the query becomes a function and you could enter the name of the excel file and all of them will have the first row and the last row deleted.
Regards,
Daniel He
Hi @Anonymous,
Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?
Regards,
Daniel He
Hi @Anonymous,
Based on test, you could refer to below steps in query editor:
Sample excel files in my folder:
1.Get data from one of the excel files(here is A) and delete the first and last row.
2.Modify the code in advanced editor.
Before modify:
Insert this code and modify the source:
(para as text) as table => let Source = Excel.Workbook(File.Contents("C:\Users\danielh\Desktop\Parameter\"¶&".xlsx"), null, true),
After modify:
Here the query becomes a function and you could enter the name of the excel file and all of them will have the first row and the last row deleted.
Regards,
Daniel He
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |