Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
hello,
in fabric dataflow, after some transformations, I have got the data.
Now I would like to save this data as excel.
How do I do this?
thanks
Solved! Go to Solution.
Hi @Anonymous
I am adding the code snippet here:
import pandas as pd
df = spark.sql("SELECT * FROM lakehouse_1.customers_1000")
df1= df.toPandas()
df1.to_excel('abfss://Fabric_new_04@msit-onelake.dfs.fabric.microsoft.com/lakehouse_1.Lakehouse/Files/sample.xlsx')
Just replace with the abfss path of your lakehouse files folder.
Hope this helps.
Hi @Anonymous
Thanks for using Fabric Community.
Unfortunately, Fabric Dataflow (Gen2) itself doesn't have a built-in functionality to directly save the transformed data as an Excel file. However, you can achieve this by integrating Dataflow with Notebooks:
1) Give the destination as lakehouse in Dataflow Gen2 and publish the Dataflow . This will create a new table in your lakehouse.
2) Create a new notebook and run the below code:
3) The excel file will be created in Lakehouse files section.
4) You can also download this file into your local desktop using Onelake explorer.
Access Fabric data locally with OneLake file explorer - Microsoft Fabric | Microsoft Learn
5) Download the latest version of Onelake explorer and sync the Lakehouse.
Hope this helps. Please let me know if you have any further questions.
can you please send the pyspark equivalent to your notebook code?
thank you
Hi @Anonymous
I am adding the code snippet here:
import pandas as pd
df = spark.sql("SELECT * FROM lakehouse_1.customers_1000")
df1= df.toPandas()
df1.to_excel('abfss://Fabric_new_04@msit-onelake.dfs.fabric.microsoft.com/lakehouse_1.Lakehouse/Files/sample.xlsx')
Just replace with the abfss path of your lakehouse files folder.
Hope this helps.
now that I can save the dataframe as .xlsx, how do I open the excel file which is now in the Files folder?
my goal is to eventually email this excel file to someone
thanks
Hi @Anonymous
As specified above you can use Onelake explorer in your local machine to download the file. Then you can send it via email.
You can also download this file into your local desktop using Onelake explorer.
Access Fabric data locally with OneLake file explorer - Microsoft Fabric | Microsoft Learn
Download the latest version of Onelake explorer and sync the Lakehouse.
Hope this helps. Please let me know if you have any further questions.
Hi @Anonymous
Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Fabric update to learn about new features.