Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to 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
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
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.
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.
The file name is correct, the path is correct it's only an issue when using wildcards (*)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.
User | Count |
---|---|
16 | |
15 | |
4 | |
4 | |
3 |