Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
How i can export the data from power BI service using python??
or simply how to write a code in python for POWER BI service for exporting data in a file ??
Solved! Go to Solution.
Hi. PowerBi can't run python on demand. You have two alternatives to export data with python:
1- Prepare the code on the ETL. If you write a python transformation on PowerQuery, that means you need a gateway and a VM to run the transformations. That will let you write a code to export the current frame to the local filesystem of the VM and continue with the steps of the query to load the usual data. You can read more here: https://blog.ladataweb.com.ar/post/617917545084846080/powerbi-exportar-un-datos-automáticamente-al
2- Execute a DAX Query to the dataset with the PowerBi Rest API. There is a request on the API that let's you run a query against the model. You could run it, store it on a variable and export if you want. More info: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries
If you like python I would suggest using a Python lib to make the code for the API easier. Something like SimplePBI that already has an object dataset to execute the query with a parameter to return a pandas dataframe.
I hope that helps,
Happy to help!
Thanks for writing this. My requirement is to export a Power BI visual content into a excel file with 1.5 million records on average per day and save it in my local drive. Is there a way to do this as well. specific for a table visual i need . i qlik view i could export 1million easily from table visual and need the same in power bi service .i tried using paginated report but it chokde all the memory and after 3 hrs no output as i have 42 columns in output but i could export for 5 columns only in paginated reports
Hi. PowerBi can't run python on demand. You have two alternatives to export data with python:
1- Prepare the code on the ETL. If you write a python transformation on PowerQuery, that means you need a gateway and a VM to run the transformations. That will let you write a code to export the current frame to the local filesystem of the VM and continue with the steps of the query to load the usual data. You can read more here: https://blog.ladataweb.com.ar/post/617917545084846080/powerbi-exportar-un-datos-automáticamente-al
2- Execute a DAX Query to the dataset with the PowerBi Rest API. There is a request on the API that let's you run a query against the model. You could run it, store it on a variable and export if you want. More info: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries
If you like python I would suggest using a Python lib to make the code for the API easier. Something like SimplePBI that already has an object dataset to execute the query with a parameter to return a pandas dataframe.
I hope that helps,
Happy to help!