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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ArwaAldoud
Super User
Super User

Unable to Read Multiple Excel Files Using Wildcard (*) inUnable to Read Mult Lakehouse using PySpark

I’m trying to read multiple Excel (.xlsx) files from a folder in Lakehouse using Notebook PySpark. However, when I use a wildcard (*), I get a FileNotFound error.

 

Code that fails (attempting to read multiple files using wildcards):

df_sales = pd.read_excel("abfss://{lakehouse}@onelake.dfs.fabric.microsoft.com/Files/Sales*.xlsx", sheet_name="Sales")

Error Message: Using a wildcard (*) results in FileNotFound.

 

and the Code that works (reading a single file):

df_sales = pd.read_excel("abfss://{lakehouse}@onelake.dfs.fabric.microsoft.com/Files/Current/Sales_2023.xlsx", sheet_name="Sales")

When specifying the exact file name, it works fine.

 

Any guidance or best practices would be greatly appreciated

 

 

 

 

1 ACCEPTED SOLUTION

Thank you for your detailed response.

I followed your steps, but unfortunately, it didn’t work for me. Instead, I specified the exact file name in my scenario, and it worked fine.

I appreciate your support and guidance

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @ArwaAldoud,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please "Accept  as  Solution" and give a 'Kudos' so other members can easily find it.

Thank you,
Pavan.

Thank you for your detailed response.

I followed your steps, but unfortunately, it didn’t work for me. Instead, I specified the exact file name in my scenario, and it worked fine.

I appreciate your support and guidance

Anonymous
Not applicable

Hi @ArwaAldoud,

We trust that your issue has been resolved. Kindly mark my solution as "Accept as Solution." Additionally, give it a 'Kudos' to help others find it easily.

If you need any further assistance, feel free to reach out.

Please continue using Microsoft community forum.

Thank you,
Pavan.

I truly appreciate your help.
Thanks again, and I’ll continue engaging in the Microsoft Community Forum.

Anonymous
Not applicable

Hi @ArwaAldoud,

Thank you for reaching out in Microsoft Community Forum.

The wildcard (*) in pd.read_excel() is not supported because Pandas expects an exact file path.

please follow below steps to acheive the error;

1. Use dbutils.fs.ls() to get all Excel files in the folder and read them one by one into Pandas.

2. For improved performance and scalability, it is recommended to use PySpark and leverage Spark’s Excel reader (com.crealytics.spark.excel) to efficiently read multiple files.

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

ArwaAldoud
Super User
Super User

The file name is correct, the path is correct it's only an issue when using wildcards (*)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors