March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Good Day,
While importing/merging multiple sheets from an excel file, I realised that :
- the column names and the columns order are the same in all the sheets (what is good as I want to merge all of them)
- but in some sheets the starting cell differs. i.e : almost all sheet tables start at cell A1, but some start at B1
Is it possible with M language to set a condition on a column values and if respected , all the values of will be shifted by 1 column???
Example:
https://drive.google.com/file/d/0B_gA_LQC4vQhMkVUbjZnd1pLREE/view?usp=sharing
On sheet 3 , the table is shifted. But I still want to have a perfect merging
Solved! Go to Solution.
https://drive.google.com/file/d/0B4dPgH9_BPBrbnR3bmJzUEJEajA/view?usp=sharing
I created a function which will reach all sheets from excel file. You can provide excel file name in the parameter.
In step3 (Expanded GetSheetData) of "MyData" table called, you can select the columns you want, if sheets has more column or blank, only selected column will get combined.
Thanks,
P
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Probabaly not as you describe. Any reason why you can't delete the blank column A:A and be done with it?
I think if you selected one of the workbooks starting at B1 as the sample to combine, it could work. After the column headers are promoted, there should be a blank column in the first column. When the other workbooks are processed, they won't have this blank column. But all other columns should match. When they are all appended it should give a superset of all columns including the blank one. Just delete the blank column as the last step before load.
Thx Matt for your answer.
I want all the columns to match as final result. I ve added a sample . Thank you for your support.
https://drive.google.com/file/d/0B4dPgH9_BPBrbnR3bmJzUEJEajA/view?usp=sharing
I created a function which will reach all sheets from excel file. You can provide excel file name in the parameter.
In step3 (Expanded GetSheetData) of "MyData" table called, you can select the columns you want, if sheets has more column or blank, only selected column will get combined.
Thanks,
P
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi Parry2k,
it works perfectly with the sample worksheets.
I changed the parameters to apply it to my main worksheet and few challenges happened:
1- The worksheet has 52 sheets to be passed trough the function, and it takes a while to compute with my core i5, 2,6Ghz (5minutes+)
When I just extract in bulk it takes less than a minute. Any way I can optimize?
can you share example sheets
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I added a link to the post.
thx in advance
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |