We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Python Scripts in Power Query

Power Query isn't limited to point-and-click transformations. It can also run Python scripts!

We won't be writing Python scripts in this course, but it's good to know the option exists if you already work with Python in your workflows.

You can find this option by going to New Source → Other → Python Script in the Power Query editor.

From there, Power BI will execute your Python code and load the results as a dataset inside your report.

This is especially useful for:

  • Data transformations that are easier in Pandas
  • Machine learning or statistical analysis
  • Pulling data from APIs