Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I would like to export the data via python to csv and set the download file as a parameter in Power query.
I set a parameter called Export_destination = C:\Users\Name\Desktop And I write a python script for export as follows,
```
Export_destination = "&Text.From(Export_destination)&"
import pandas as pd
data = pd.DataFrame(dataset)
data.to_csv(r'{Export_destination}\test.csv')
```
However, the script still can not work. Does anyone have a good solution for this question?
Solved! Go to Solution.
Hi @Anonymous
There probably are other ways, one way is to get your final file in another power query step
Export_destination = Export_destination&"\test.csv" //this is power query step
....
import pandas as pd
data = pd.DataFrame(dataset)
data.to_csv(r'"&Export_destination&"')
or call the parameter in Python, concat your filename directly...actually you can do dateset.to_csv directly...
import pandas as pd
data = pd.DataFrame(dataset)
data.to_csv(r'"&Export_destination&"\test.csv')
Hi @Anonymous ,
Could you tell me if @Anonymous 's post helps you? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.
Best Regards,
Eyelyn Qin
Hi @Anonymous
There probably are other ways, one way is to get your final file in another power query step
Export_destination = Export_destination&"\test.csv" //this is power query step
....
import pandas as pd
data = pd.DataFrame(dataset)
data.to_csv(r'"&Export_destination&"')
or call the parameter in Python, concat your filename directly...actually you can do dateset.to_csv directly...
import pandas as pd
data = pd.DataFrame(dataset)
data.to_csv(r'"&Export_destination&"\test.csv')
why is error display that?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |