Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
fahadarshad
Helper I
Helper I

How to get specific rows from multiple excel files

Hello everyone

 

I have multiple excel files, with multiple excel sheets. What I intend to do is to go in every sheet of every excel file in a particular folder and only pick out the rows from those sheets that are between certain cells with certain contents.

 

For example:

 

excelfile1 has sheet1 where in row 17 there is a cell with content that says "List of shops" and then the subsequent rows have data about shops. Once the list of shops is finished the next cell reads "list ends here". each sheet in each excel can have any number of shops in the list. some might have 4, others might have 14. but i only need the row data from each sheet in each excel that is between those cells "list of shops" & "list ends here"

 

Also for each of the rows picked up i need a column that says while file-sheet name the data was picked from.

 

Kindly help. Thanks

1 ACCEPTED SOLUTION

Try this on for size.  I made some assumptions about your data...  If you need something different just repost.

 

Getting Shop List from Excel Workbooks and Sheets 

 

Thanks,

 

John

View solution in original post

6 REPLIES 6
v-juanli-msft
Community Support
Community Support

Hi @fahadarshad 

I tried with JohnThomas's method, it works on my side.

Just a little modification to fit my scenario, it works.

Capture3.JPG

If you have any problem, feel free to ask us.

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

camargos88
Community Champion
Community Champion

@fahadarshad ,

 

Try filtering it on your sample file.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



JohnThomas
Helper II
Helper II

Can you upload some sample workbooks?

Here you go,

 

I just need the rows that have shop names, nothing before of after that.

Try this on for size.  I made some assumptions about your data...  If you need something different just repost.

 

Getting Shop List from Excel Workbooks and Sheets 

 

Thanks,

 

John

This seems rather simple.  Can't you just filter your column to anything with the word "Shop" or "List" in it?  Or are the Shop 1, Shop 2, etc. realy some other names?

 

= Table.SelectRows(#"Previous Step", each Text.Contains([ShopList], "Shop") or Text.Contains([ShopList], "List"))

 

Is the data in a table, or just raw data in worksheets?

 

Is there a column header?  Are you needing to know how to filter the list, or is the real problem combining all the sheets and files together into one table with all shops?

 

It will help structure a good solution to your problem if your sample data is as close to real as you can get it.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.