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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

save data in excel

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vnikhilanmsft_0-1716547187696.png

vnikhilanmsft_0-1716547413147.png

 



Hope this helps.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

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.

vnikhilanmsft_0-1716546190813.png

 

vnikhilanmsft_1-1716546215216.png


2) Create a new notebook and run the below code:

vnikhilanmsft_2-1716546261320.png


3) The excel file will be created in Lakehouse files section.

vnikhilanmsft_3-1716546345377.png


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.

vnikhilanmsft_4-1716546457629.pngvnikhilanmsft_5-1716546528738.png


Hope this helps. Please let me know if you have any further questions.







Anonymous
Not applicable

can you please send the pyspark equivalent to your notebook code?

thank you

Anonymous
Not applicable

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.

vnikhilanmsft_0-1716547187696.png

vnikhilanmsft_0-1716547413147.png

 



Hope this helps.

Anonymous
Not applicable

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

Anonymous
Not applicable

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.

vnikhilanmsft_0-1716794456943.png

 

vnikhilanmsft_1-1716794456739.png

 

Hope this helps. Please let me know if you have any further questions.

Anonymous
Not applicable

Hi @Anonymous 

Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.

Helpful resources

Announcements
April Fabric Update Carousel

Fabric Monthly Update - April 2026

Check out the April 2026 Fabric update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Top Solution Authors
Top Kudoed Authors