Forum Discussion
Anonymous
7 years agoNot applicable
How to Export Query in Power BI Desktop as CSV
Hello Community, Can someone let me know how to export a query generated from the Query Editor to a CSV file? Thanks Carlton
- 7 years ago
Hi Anonymous,
Based on my research, in query editor, there is not a function to output a csv file in Power BI, I suggest you to try below solutions:
1.You could copy the table you want to export in data view after you have applied your queries.
Reference:https://community.powerbi.com/t5/Desktop/How-to-export-some-huge-query-results-in-excel/td-p/200084
2.You could use the Dax Studio to export the file you want.
Rference:https://community.powerbi.com/t5/Desktop/Export-to-csv-from-Power-Query/td-p/193423
Regards,
Daniel He
Anonymous
1 year agoNot applicable
Use this code as python script in power query to save.
# 'dataset' holds the input data for this script
import pandas as pd
# Convert dataset to a DataFrame
df = pd.DataFrame(dataset)
# Save to a CSV file
output_path = r"C:\Users\pqdigder\Downloads\all_data.csv" # Update this path as needed
df.to_csv(output_path, index=False) # `index=False` prevents adding row numbers