Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Hi,
Hopefully someone can help me out with the following. I want to create a csv file from a query in Fabric (being to big for Excel). Do I need to create such a csv with Python or are there other possibilities? Could someone help me out with a script to extra data to csv from Fabric?
Many thanks,
Michiel
Solved! Go to Solution.
Hello @Msoede
Please give it a try:
df = spark.sql("YOUR SQL QUERY HERE")
# Save the Spark DataFrame as a CSV file
df.write \
.option("header", "true") \
.option("delimiter", ",") \
.mode("overwrite") \
.csv("/lakehouse/default/Files/your_file_name.csv")
Hi @Msoede ,
Thank you for reaching out to us on the Microsoft Fabric Community Forum.
You can create a CSV file from a query in Fabric
Providing the reference thread which may assist you in addressing the query:
Solved: save data to .csv - Microsoft Fabric Community
If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.
Regards,
Menaka
Hello @Msoede
Please give it a try:
df = spark.sql("YOUR SQL QUERY HERE")
# Save the Spark DataFrame as a CSV file
df.write \
.option("header", "true") \
.option("delimiter", ",") \
.mode("overwrite") \
.csv("/lakehouse/default/Files/your_file_name.csv")
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 |
---|---|
3 | |
1 | |
1 | |
1 | |
1 |