Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
HamidBee
Power Participant
Power Participant

Clarifying Data Transformation Process in Power BI When Using Python Script in 'Get Data'

Hi All, 

 

I have a specific query regarding the use of Python scripts for data import in Power BI. My process involves using the 'Get Data' feature in Power BI, where I choose Python as the data source. I provide the file path and execute some data transformation steps directly within the Python script at this stage, before the data is imported into Power BI.

 

My question is: Where exactly do these data transformations take place? Are they processed within the Power BI environment, or do they occur externally, in a manner similar to how query folding works with SQL data sources?.

 

To clarify further, I am not performing these transformations within the Power BI's Power Query using Python. Instead, these transformations are part of the Python script used in the initial data retrieval stage ('Get Data'). I'm trying to understand if Power BI simply imports the transformed data as-is, or if it plays any role in the transformation process, especially in terms of efficiency and performance.

 

Thanks in advance.

3 REPLIES 3
HamidBee
Power Participant
Power Participant

Hi @lbendlin. Thank you for your reply. Just to make sure I've understood correctly. Let's assume the Power BI report has not yet been published but is currently being built. I use Python to apply transformation steps when using the Get Data method. Are you saying this workload is done by the Python environment outside of Power BI?.

 

Which kind of leads me to my next question. If I import a file via Python, apply Power Query M transformations and then apply some more Python transformations in Power Query. Would this still mean all of the workload is pushed outside of Power BI to the python environment?.

Thanks in advance. 

 

Are you asking "will it fold?"  ?  I would doubt that but don't know for sure.  You can test it and seee for yourself.

lbendlin
Super User
Super User

Any Python or R script or visual mandates the use of a Personal Gateway.  That already tells you where the processing is happening - on your PC, or on the PC where the Personal Gateway app is running.

 

In my opinion this disqualifies the use of Python or R for any ETL work.  Doesn't seem to stop people from trying though, including attempts at data write back.  

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.