Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
We are going to use Power BI to extract data from Database A and B, and then joining the tables in Power BI, and then store the report data to Database B and send the result report (in CSV or Excel)to user.
is the below workflow is possible?
1. Create Python script to Call Power BI API to run the report and retrieve the Report Data, and save report to DB<is there any API can retrive the report in CSV> ?
2. Use Power Automate to call the python script
Hi @pennyhoho117
Hope you are doing well!
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @pennyhoho117
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Yes, your workflow is possible with some adjustments. Power BI’s REST API does not directly export report data as CSV/Excel, but you can use the Dataset API to run DAX queries (/datasets/{datasetId}/executeQueries) and extract data, then process it with Python to save it to Database B. Alternatively, the Export to File API can export reports in PDF or other formats, but not CSV. After processing the data in Python, use libraries like pyodbc or SQLAlchemy to store it in Database B. Power Automate can then trigger the Python script via HTTP requests, scheduled flows, or Power Automate Desktop. Ensure you have appropriate API permissions, optimize DAX queries for performance, and set up Power Automate to notify users with the final report via email. This approach enables efficient automation of report generation and delivery.
Thanks for reaching out to Microsoft Fabric Community Forum.
Yes, the workflow you described is possible with some modifications.
Power BI REST API:
Power Automate:
Modify Python Script:
Distribute Report:
If my response has resolved your query, please mark it as the Accepted Solution to help others. Additionally, I would appreciate a 'Kudos' if you found my response helpful.
Thank you!
hi if we dont want to use power automate desktop, then any other possible approach to call our python files in cloud?
To execute Python scripts in the cloud without using Power Automate Desktop, these are the following approaches:
1. Azure Functions:
2. CI/CD Tools:
3. Google Cloud Functions:
If you find this post helpful, please mark it as an "Accept as Solution" and give a KUDOS.
Thank You!
Why when call python in power bi deskop return with error such as ImportError: No module named 'psycopg2'? can install libraies in power bi desktop?
The error ImportError: No module named 'psycopg2' occurs because the Python environment used by Power BI Desktop cannot locate the psycopg2 library. In Power BI Desktop, it is not possible to install Python libraries directly within the application.
1. Verify Python Installation Path in Power BI Desktop:
In Power BI Desktop:
2. Install the Missing Library:
If you find this post helpful, please mark it as an "Accept as Solution" and give a KUDOS.
Thank You!
Hi If you are in cloud then you could use Azure Functions to execute the python scripts it is a service with serverless compute
if this post helped please do give a kudos
Thanks in advance
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
33 | |
32 | |
27 | |
23 |
User | Count |
---|---|
40 | |
33 | |
19 | |
18 | |
16 |